Commit graph

480 commits

Author SHA1 Message Date
David Anson
a0b9ee019a Update demo page to split multi-character characters for accurate highlighting.
Some checks are pending
Checkers / linkcheck (push) Waiting to run
Checkers / spellcheck (push) Waiting to run
CI / build (20, macos-latest) (push) Waiting to run
CI / build (20, ubuntu-latest) (push) Waiting to run
CI / build (20, windows-latest) (push) Waiting to run
CI / build (22, macos-latest) (push) Waiting to run
CI / build (22, ubuntu-latest) (push) Waiting to run
CI / build (22, windows-latest) (push) Waiting to run
CI / build (24, macos-latest) (push) Waiting to run
CI / build (24, ubuntu-latest) (push) Waiting to run
CI / build (24, windows-latest) (push) Waiting to run
CI / pnpm (push) Waiting to run
CodeQL / Analyze (push) Waiting to run
TestRepos / build (latest, ubuntu-latest) (push) Waiting to run
UpdateTestRepos / update (push) Waiting to run
2025-08-24 00:32:16 -07:00
David Anson
10db83f719 Update demo web page to highlight all error lines and ranges by default, encode single quotes in attributes. 2025-08-07 20:50:43 -07:00
David Anson
c81101d2b1 Address new lint warnings from previous commit. 2025-06-22 22:24:09 -07:00
David Anson
dda89f90d4 Update demo web page to remove recognized front matter from rendered HTML output. 2025-06-02 22:07:21 -07:00
David Anson
599b687849 Use double quotes for HTML attribute of demo page containing JSON.stringify output (because that escapes double quotes but not single quotes and encodeURIComponent also ignores single quotes). 2024-12-16 20:14:33 -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
65eeb4c8d9 Suppress (hidden) expected Webpack warnings due to dynamic require and bundle size. 2024-12-10 21:56:14 -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
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
d96bc9c97f Restore markdown-it script to browser demo to support "?renderer=markdown-it". 2024-10-25 20:40:18 -07:00
David Anson
e708143a28 Update to version 0.36.0. 2024-10-25 19:59:23 -07:00
David Anson
16512bba25 Reorder operations in getDescendantsByType helper for ~1% runtime reduction. 2024-10-23 22:05:44 -07:00
David Anson
e6e799d145 Reorder checks in filterByTypes helper predicate for ~2% runtime reduction. 2024-10-23 21:44:36 -07:00
David Anson
d94b78e6bf Refactor getEvents slightly to avoid modifying the MicromarkParseOptions object. 2024-10-22 22:03:05 -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
effab8d513 Internal type-only rename for clarity. 2024-10-19 15:28:05 -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
29ebb28f10 Convert from window to globalThis in demo web app script file. 2024-10-03 21:31:13 -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
David Anson
33631a5984 Split micromark.cjs into separate -parse and -helpers files. 2024-09-28 16:26:38 -07:00
David Anson
97effd921e Refactor helpers slightly for consistency. 2024-09-28 15:55:26 -07:00
David Anson
124b7e2276 Refactor to remove helper withinAnyRange. 2024-09-28 15:41:40 -07:00
David Anson
5e568d0da9 Refactor to remove micromark helper getExclusionsForToken. 2024-09-27 23:58:49 -07:00
David Anson
8cbbed8e79 Refactor to remove micromark helper getTokenTextByType, update getDescendantsByType to allow sub-arrays. 2024-09-24 22:48:14 -07:00
David Anson
87daa5b06c Refactor to remove micromark helper matchAndGetTokensByType. 2024-09-18 21:02:59 -07:00
David Anson
2ea3f95fd1 Refactor micromark helper getTokenTextByType to be more efficient, remove tokenIfType helper for being redundant. 2024-09-16 20:50:54 -07:00
David Anson
b749d9fbb4 Remove markdown-it script from browser demo as it will no longer be needed now that the markdown-it parser is not run by default and the demo does not support custom rules. 2024-09-15 22:52:25 -07:00
David Anson
98ff66209d Move markdown-it token manipulation code into a separate file which is only require()-ed if/when needed. 2024-09-14 17:33:46 -07:00
David Anson
164bbac651 Add @stylistic/eslint-plugin to ESLint configuration. 2024-09-01 16:16:05 -07:00
David Anson
fe02674ce0 Update to version 0.35.0. 2024-08-28 20:41:14 -07:00
David Anson
6d097cce3f Add missing semicolon to address new code scanning warning. 2024-08-27 20:55:15 -07:00
David Anson
9c8e7156e1 Create strict JSON Schema for configuration (standalone for ease of use) and corresponding strict TypeScript type (via extends for conciseness) (fixes #1248). 2024-08-27 20:47:33 -07:00
David Anson
dfcb4529f3 Cache all top-level calls to filterByTypes (~7% runtime reduction). 2024-08-24 22:05:16 -07:00
David Anson
85e704f32a Update to only invoke rules that are used at least once by the content. 2024-08-22 20:35:01 -07:00
David Anson
ea8d596a9b Stop running the markdown-it parser unless a custom rule that requires it is present (~7% runtime reduction). 2024-08-21 21:19:52 -07:00
David Anson
7aac5b0553 Refactor to remove flattenedLists, indentFor, listItemMarkerRe, orderedListItemMarkerRe, rangeFromRegExp, and unorderedListStyleFor helpers, reimplement MD004/MD029 using micromark tokens. 2024-08-20 21:36:17 -07:00
David Anson
55729cfcf7 Remove filterTokens helper (now used only by tests). 2024-08-18 15:34:26 -07:00
David Anson
2b8369ae39 Update MD031/blanks-around-fences to handle missing close fence. 2024-08-17 20:29:27 -07:00