Commit graph

641 commits

Author SHA1 Message Date
David Anson
92cd6d51cb Add tests for previous commit to avoid invoking Micromark parser when not needed, improve type definitions slightly (closes #1564). 2025-04-20 04:59:27 +00:00
Yury Puzynya
759c31760e Avoid invoking Micromark parser when no Micromark-based rules are in effect. 2025-04-20 04:58:27 +00:00
David Anson
02478d24cf Update MD051/link-fragments to add the ignored_pattern configuration parameter (fixes #547). 2025-04-05 22:35:07 -07:00
David Anson
a9417fdf67 Update MD036/no-emphasis-as-heading to ignore HTML comments at the beginning or ending of the emphasised heading (fixes #1267). 2025-03-30 17:30:21 -07:00
David Anson
62dc79864d Update MD041/first-line-heading to add an allow_preamble parameter (fixes #1416). 2025-03-22 16:16:10 -07:00
David Anson
95f82760ce Update MD041/first-line-heading to avoid scanning every token with Array.filter. 2025-03-16 20:04:14 -07:00
David Anson
5fc91f6977 Update MD025/single-title to ignore preceding blank lines and comments when looking for a title (top-level heading) (fixes #1420). 2025-03-15 17:52:22 -07:00
David Anson
50300fa7af Update MD051/link-fragments to allow HTML's implicit "#top" fragment (fixes #1488). 2025-03-15 16:30:32 -07:00
David Anson
5749c8dcf7 Update MD043/required-headings to support "?" meaning "exactly one unspecified heading" (fixes #475). 2025-03-10 21:57:39 -07:00
David Anson
435c55f72a Update MD027/no-multiple-space-blockquote to add a list_items parameter (fixes #1473). 2025-03-03 23:22:37 -08:00
David Anson
d02090db2c Remove outdated use of "@ts-expect-error https://github.com/microsoft/TypeScript/issues/52529". 2025-03-03 22:57:01 -08:00
David Anson
63147ee1eb Add comprehensive tests for parseConfiguration function, handle non-object parser results consistently (fixes #1523). 2025-03-01 18:23:48 -08:00
David Anson
1f237e6c54 Refactor to move parseConfiguration function into a separate file, add stronger typing, add first test case. 2025-02-28 20:26:06 -08:00
David Anson
571c2353ea Update new rule MD059/descriptive-link-text for project-level consistency. 2025-02-13 22:11:42 -08:00
Kate Higa
b8374ec5d2 Add rule MD059/descriptive-link-text "Link text should be descriptive" (fixes #681). 2025-02-13 22:11:42 -08:00
David Anson
44c302fe0b Allow options.markdownItFactory to be implemented asynchronously so the markdown-it parser import can be deferred. 2025-02-08 15:08:10 -08:00
David Anson
d4b981bcb3 Introduce options.markdownItFactory (and remove options.markdownItPlugins) so the markdown-it parser can be removed as a direct dependency because it is no longer used by default. 2025-02-08 15:08:06 -08:00
David Anson
3cbe1cb6c5 Refactor micromark parse code to stop using micromark's TokenizeContext.sliceSerialize (less well supported) in favor of Token.start/end.offset. 2025-02-08 14:43:38 -08:00
David Anson
b23fc96ab2 Refactor MD038/no-space-in-code to produce smaller/simpler edits and address an additional scenario. 2025-02-07 20:03:30 -08:00
David Anson
90cf515ff0 Update MD038/no-space-in-code to allow code spans with only spaces (fixes #1481). 2025-02-02 21:36:35 -08:00
David Anson
a4c553a45a Update to version 0.37.4. 2025-01-14 23:39:35 -08:00
David Anson
53ff5c43f1 Stop using module.createRequire (problematic under webpack), incorporate and export resolveModule helper from markdownlint-cli2. 2025-01-14 23:30:09 -08:00
David Anson
637975f517 Update MD039/no-space-in-links to remove outdated validLink helper and simplify slightly. 2025-01-06 20:28:53 -08:00
David Anson
74b1c195e3 Update to version 0.37.3. 2024-12-30 19:48:55 -08:00
David Anson
ef70472df7 Make micromark-core-commonmark a direct dependency to satisfy strict dependency resolution (e.g., pnpm). 2024-12-31 03:36:56 +00:00
David Anson
5fad452106 Update to version 0.37.2. 2024-12-18 21:31:43 -08:00
David Anson
8ad4698536 Update MD032/blanks-around-lists to ignore (end-appended) undefined reference tokens when determining the last line of a list (fixes #1453). 2024-12-16 20:54:37 -08:00
David Anson
af086995ed Update to version 0.37.1. 2024-12-14 20:16:59 -08:00
David Anson
a009407088 Add support for "browser" condition (e.g., as used by Webpack) by stubbing-away Node imports (fixes #1441). 2024-12-11 18:48:54 -08:00
David Anson
8b26129d55 Convert types.d.mts from ambient module declaration to module augmentation which enables VS Code to handle @type {import("markdownlint").Rule} (https://www.typescriptlang.org/docs/handbook/modules/reference.html#ambient-modules), fix broken markdownlint @typedefs in helpers/*.cjs. 2024-12-10 21:47:06 -08:00
David Anson
62073a8fde Update to version 0.37.0. 2024-12-07 18:12:13 -08:00
David Anson
8da43dd246 Update to use named exports via / /async /promise /sync, simplify references via self-referencing, refine examples. 2024-12-03 19:58:47 -08:00
David Anson
789190962c Remove import of node:util and manually implement promisify (improves browser scenario), improve JSDoc typing. 2024-11-30 21:44:37 -08:00
David Anson
3599f694ba Move micromark-parse.mjs from helpers to library, remove all dependencies from helpers. 2024-11-30 20:42:14 -08:00
David Anson
1e71f6f44e Convert markdownlint library to an ECMAScript module, replace markdownlint-micromark with micromark, stop publishing (large) markdownlint-browser.js, see https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c for guidance. 2024-11-29 18:29:21 -08:00
David Anson
0eedda0a6c Update MD027/no-multiple-space-blockquote to handle multiple lines of indented code inside a blockquote (fixes #1393). 2024-10-28 21:40:39 -07:00
David Anson
368cb1be5f Update to version 0.36.1. 2024-10-27 22:10:33 -07:00
David Anson
a7a50eaa39 Update MD054/link-image-style to handle autolinked email addresses when disallowed (fixes #1391). 2024-10-27 22:02:33 -07:00
David Anson
e708143a28 Update to version 0.36.0. 2024-10-25 19:59:23 -07:00
David Anson
38b4ec0c2f Refactor use of micromark so token stream is authentic by shimming undefined link reference handling, remove no-longer-necessary parse operation in MD034. 2024-10-21 20:56:22 -07:00
David Anson
5e1b269fa5 Refactor to freeze parser tokens only when custom rules are present (negligable performance improvement). 2024-10-11 22:18:51 -07:00
David Anson
d22c1f19ef Refactor various code to do shallow/constrained search instead of deep search for better performance, make cache key for filterByTypesCached unique. 2024-10-09 22:42:36 -07:00
David Anson
04c693b00b Update MD051/link-fragments to add ignore_case parameter and improve documentation (fixes #1274). 2024-10-08 22:40:25 -07:00
David Anson
c5d4a3297f Move single use, not explicitly tested helpers into the file that uses them. 2024-10-06 20:59:28 -07:00
David Anson
4e30462216 Promote applyFix and applyFixes helpers into core library. 2024-10-06 17:24:44 -07:00
David Anson
e0219411c6 Refactor RegExps to avoid the possibility of polynomial backtracking (fixes #657). 2024-10-05 18:07:45 -07:00
David Anson
9b1840a5a4 Improve type-correctness of some helpers. 2024-10-04 23:05:34 -07:00
David Anson
5182911acc Refactor to remove helpers addErrorContextForLine and blockquotePrefixRe, add micromark helper getBlockQuotePrefixText. 2024-10-04 22:41:46 -07:00
David Anson
5cc40c54b7 Enable custom rules to use the micromark parser, export micromark helpers for reuse. 2024-10-01 22:53:46 -07:00
David Anson
d3819c4e75 Add markdownlint "version" property to custom rule "params" object in case it is ever necessary for a rule to specialize its behavior. 2024-09-29 18:11:41 -07:00