diff --git a/demo/markdownlint-browser.js b/demo/markdownlint-browser.js index 0609de00..c1dd3656 100644 --- a/demo/markdownlint-browser.js +++ b/demo/markdownlint-browser.js @@ -1150,9 +1150,24 @@ var flatTokensSymbol = Symbol("flat-tokens"); * @property {number} endColumn End column (1-based). * @property {string} text Token text. * @property {Token[]} children Child tokens. - * @property {Token[]} [htmlFlowChildren] Child tokens for htmlFlow. */ +/** + * Returns whether a token is an htmlFlow type containing an HTML comment. + * + * @param {Token} token Micromark token. + * @returns {boolean} True iff token is htmlFlow containing a comment. + */ +function isHtmlFlowComment(token) { + var text = token.text, + type = token.type; + if (type === "htmlFlow" && text.startsWith("")) { + var comment = text.slice(4, -3); + return !comment.startsWith(">") && !comment.startsWith("->") && !comment.endsWith("-") && !comment.includes("--"); + } + return false; +} + /** * Parses a Markdown document and returns Micromark events. * @@ -1205,6 +1220,7 @@ function micromarkParseWithOffset(markdown, micromarkOptions, referencesDefined, var history = [current]; var reparseOptions = null; var lines = null; + var skipHtmlFlowChildren = false; var _iterator = _createForOfIteratorHelper(events), _step; try { @@ -1222,7 +1238,7 @@ function micromarkParseWithOffset(markdown, micromarkOptions, referencesDefined, var endColumn = end["column"], endLine = end["line"]; var text = context.sliceSerialize(token); - if (kind === "enter") { + if (kind === "enter" && !skipHtmlFlowChildren) { var previous = current; history.push(previous); current = { @@ -1234,7 +1250,11 @@ function micromarkParseWithOffset(markdown, micromarkOptions, referencesDefined, text: text, "children": [] }; - if (current.type === "htmlFlow") { + previous.children.push(current); + flatTokens.push(current); + // @ts-ignore + if (current.type === "htmlFlow" && !isHtmlFlowComment(current)) { + skipHtmlFlowChildren = true; if (!reparseOptions || !lines) { reparseOptions = _objectSpread(_objectSpread({}, micromarkOptions), {}, { "extensions": [{ @@ -1246,15 +1266,20 @@ function micromarkParseWithOffset(markdown, micromarkOptions, referencesDefined, lines = markdown.split(newLineRe); } var reparseMarkdown = lines.slice(current.startLine - 1, current.endLine).join("\n"); - current.htmlFlowChildren = micromarkParseWithOffset(reparseMarkdown, reparseOptions, referencesDefined, current.startLine - 1); + var tokens = micromarkParseWithOffset(reparseMarkdown, reparseOptions, referencesDefined, current.startLine - 1); + current.children = tokens; + flatTokens.push.apply(flatTokens, _toConsumableArray(tokens[flatTokensSymbol])); } - previous.children.push(current); - flatTokens.push(current); } else if (kind === "exit") { - Object.freeze(current.children); - Object.freeze(current); - // @ts-ignore - current = history.pop(); + if (type === "htmlFlow") { + skipHtmlFlowChildren = false; + } + if (!skipHtmlFlowChildren) { + Object.freeze(current.children); + Object.freeze(current); + // @ts-ignore + current = history.pop(); + } } } @@ -1327,20 +1352,6 @@ function filterByTypes(tokens, allowed) { return filterByPredicate(tokens, predicate); } -/** - * Filter a list of Micromark tokens for HTML tokens. - * - * @param {Token[]} tokens Micromark tokens. - * @returns {Token[]} Filtered tokens. - */ -function filterByHtmlTokens(tokens) { - return filterByPredicate(tokens, function (token) { - return token.type === "htmlText"; - }, function (token) { - return token.htmlFlowChildren || token.children; - }); -} - /** * Gets the heading level of a Micromark heading tokan. * @@ -1432,7 +1443,6 @@ function tokenIfType(token, type) { } module.exports = { "parse": micromarkParse, - filterByHtmlTokens: filterByHtmlTokens, filterByPredicate: filterByPredicate, filterByTypes: filterByTypes, getHeadingLevel: getHeadingLevel, @@ -4836,7 +4846,7 @@ module.exports = { // For every top-level list... var topLevelLists = filterByPredicate(parsers.micromark.tokens, isList, function (token) { - return isList(token) ? [] : token.children; + return isList(token) || token.type === "htmlFlow" ? [] : token.children; }); var _iterator = _createForOfIteratorHelper(topLevelLists), _step; @@ -4903,7 +4913,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len var _require = __webpack_require__(/*! ../helpers */ "../helpers/helpers.js"), addError = _require.addError; var _require2 = __webpack_require__(/*! ../helpers/micromark.cjs */ "../helpers/micromark.cjs"), - filterByHtmlTokens = _require2.filterByHtmlTokens, + filterByTypes = _require2.filterByTypes, getHtmlTagInfo = _require2.getHtmlTagInfo; var nextLinesRe = /[\r\n][\s\S]*$/; module.exports = { @@ -4916,7 +4926,8 @@ module.exports = { allowedElements = allowedElements.map(function (element) { return element.toLowerCase(); }); - var _iterator = _createForOfIteratorHelper(filterByHtmlTokens(params.parsers.micromark.tokens)), + var tokens = params.parsers.micromark.tokens; + var _iterator = _createForOfIteratorHelper(filterByTypes(tokens, ["htmlText"])), _step; try { for (_iterator.s(); !(_step = _iterator.n()).done;) { @@ -5159,14 +5170,12 @@ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructur function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; } -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } var _require = __webpack_require__(/*! ../helpers */ "../helpers/helpers.js"), addError = _require.addError; +var _require2 = __webpack_require__(/*! ../helpers/micromark.cjs */ "../helpers/micromark.cjs"), + filterByPredicate = _require2.filterByPredicate; module.exports = { "names": ["MD037", "no-space-in-emphasis"], "description": "Spaces inside emphasis markers", @@ -5180,95 +5189,100 @@ module.exports = { var marker = _arr[_i]; emphasisTokensByMarker.set(marker, []); } - var pending = _toConsumableArray(parsers.micromark.tokens); - var token = null; - while (token = pending.shift()) { - // Use reparsed children of htmlFlow tokens - if (token.type === "htmlFlow") { - pending.unshift.apply(pending, _toConsumableArray(token.htmlFlowChildren)); - continue; - } - pending.push.apply(pending, _toConsumableArray(token.children)); - - // Build lists of bare tokens for each emphasis marker type - var _iterator = _createForOfIteratorHelper(emphasisTokensByMarker.values()), - _step; - try { - for (_iterator.s(); !(_step = _iterator.n()).done;) { - var emphasisTokens = _step.value; - emphasisTokens.length = 0; + var tokens = filterByPredicate(parsers.micromark.tokens, function (token) { + return token.children.some(function (child) { + return child.type === "data"; + }); + }); + var _iterator = _createForOfIteratorHelper(tokens), + _step; + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var token = _step.value; + // Build lists of bare tokens for each emphasis marker type + var _iterator2 = _createForOfIteratorHelper(emphasisTokensByMarker.values()), + _step2; + try { + for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { + var emphasisTokens = _step2.value; + emphasisTokens.length = 0; + } + } catch (err) { + _iterator2.e(err); + } finally { + _iterator2.f(); } - } catch (err) { - _iterator.e(err); - } finally { - _iterator.f(); - } - var _iterator2 = _createForOfIteratorHelper(token.children), - _step2; - try { - for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { - var child = _step2.value; - var text = child.text, - type = child.type; - if (type === "data" && text.length <= 3) { - var _emphasisTokens = emphasisTokensByMarker.get(text); - if (_emphasisTokens) { - _emphasisTokens.push(child); + var _iterator3 = _createForOfIteratorHelper(token.children), + _step3; + try { + for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { + var child = _step3.value; + var text = child.text, + type = child.type; + if (type === "data" && text.length <= 3) { + var _emphasisTokens = emphasisTokensByMarker.get(text); + if (_emphasisTokens) { + _emphasisTokens.push(child); + } } } + + // Process bare tokens for each emphasis marker type + } catch (err) { + _iterator3.e(err); + } finally { + _iterator3.f(); } + var _iterator4 = _createForOfIteratorHelper(emphasisTokensByMarker.entries()), + _step4; + try { + for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) { + var entry = _step4.value; + var _entry = _slicedToArray(entry, 2), + _marker = _entry[0], + _emphasisTokens2 = _entry[1]; + for (var i = 0; i + 1 < _emphasisTokens2.length; i += 2) { + // Process start token of start/end pair + var startToken = _emphasisTokens2[i]; + var startLine = lines[startToken.startLine - 1]; + var startSlice = startLine.slice(startToken.endColumn - 1); + var startMatch = startSlice.match(/^\s+\S/); + if (startMatch) { + var _startMatch = _slicedToArray(startMatch, 1), + startSpaceCharacter = _startMatch[0]; + var startContext = "".concat(_marker).concat(startSpaceCharacter); + addError(onError, startToken.startLine, undefined, startContext, [startToken.startColumn, startContext.length], { + "editColumn": startToken.endColumn, + "deleteCount": startSpaceCharacter.length - 1 + }); + } - // Process bare tokens for each emphasis marker type - } catch (err) { - _iterator2.e(err); - } finally { - _iterator2.f(); - } - var _iterator3 = _createForOfIteratorHelper(emphasisTokensByMarker.entries()), - _step3; - try { - for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { - var entry = _step3.value; - var _entry = _slicedToArray(entry, 2), - _marker = _entry[0], - _emphasisTokens2 = _entry[1]; - for (var i = 0; i + 1 < _emphasisTokens2.length; i += 2) { - // Process start token of start/end pair - var startToken = _emphasisTokens2[i]; - var startLine = lines[startToken.startLine - 1]; - var startSlice = startLine.slice(startToken.endColumn - 1); - var startMatch = startSlice.match(/^\s+\S/); - if (startMatch) { - var _startMatch = _slicedToArray(startMatch, 1), - startSpaceCharacter = _startMatch[0]; - var startContext = "".concat(_marker).concat(startSpaceCharacter); - addError(onError, startToken.startLine, undefined, startContext, [startToken.startColumn, startContext.length], { - "editColumn": startToken.endColumn, - "deleteCount": startSpaceCharacter.length - 1 - }); - } - - // Process end token of start/end pair - var endToken = _emphasisTokens2[i + 1]; - var endLine = lines[endToken.startLine - 1]; - var endSlice = endLine.slice(0, endToken.startColumn - 1); - var endMatch = endSlice.match(/\S\s+$/); - if (endMatch) { - var _endMatch = _slicedToArray(endMatch, 1), - endSpaceCharacter = _endMatch[0]; - var endContext = "".concat(endSpaceCharacter).concat(_marker); - addError(onError, endToken.startLine, undefined, endContext, [endToken.endColumn - endContext.length, endContext.length], { - "editColumn": endToken.startColumn - (endSpaceCharacter.length - 1), - "deleteCount": endSpaceCharacter.length - 1 - }); + // Process end token of start/end pair + var endToken = _emphasisTokens2[i + 1]; + var endLine = lines[endToken.startLine - 1]; + var endSlice = endLine.slice(0, endToken.startColumn - 1); + var endMatch = endSlice.match(/\S\s+$/); + if (endMatch) { + var _endMatch = _slicedToArray(endMatch, 1), + endSpaceCharacter = _endMatch[0]; + var endContext = "".concat(endSpaceCharacter).concat(_marker); + addError(onError, endToken.startLine, undefined, endContext, [endToken.endColumn - endContext.length, endContext.length], { + "editColumn": endToken.startColumn - (endSpaceCharacter.length - 1), + "deleteCount": endSpaceCharacter.length - 1 + }); + } } } + } catch (err) { + _iterator4.e(err); + } finally { + _iterator4.f(); } - } catch (err) { - _iterator3.e(err); - } finally { - _iterator3.f(); } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); } } }; @@ -5738,26 +5752,19 @@ module.exports = { var includeCodeBlocks = codeBlocks === undefined ? true : !!codeBlocks; var htmlElements = params.config.html_elements; var includeHtmlElements = htmlElements === undefined ? true : !!htmlElements; - var scannedTypes = new Set(["data", "htmlFlowData"]); + var scannedTypes = new Set(["data"]); if (includeCodeBlocks) { scannedTypes.add("codeFlowValue"); scannedTypes.add("codeTextData"); } + if (includeHtmlElements) { + scannedTypes.add("htmlFlowData"); + scannedTypes.add("htmlTextData"); + } var contentTokens = filterByPredicate(params.parsers.micromark.tokens, function (token) { return scannedTypes.has(token.type); }, function (token) { - var children = token.children; - var htmlFlowChildren = token.htmlFlowChildren, - text = token.text, - type = token.type; - if (!includeHtmlElements && type === "htmlFlow") { - children = text.startsWith("") + ) { + const comment = text.slice(4, -3); + return ( + !comment.startsWith(">") && + !comment.startsWith("->") && + !comment.endsWith("-") && + !comment.includes("--") + ); + } + return false; +} + /** * Parses a Markdown document and returns Micromark events. * @@ -91,13 +114,14 @@ function micromarkParseWithOffset( const history = [ current ]; let reparseOptions = null; let lines = null; + let skipHtmlFlowChildren = false; for (const event of events) { const [ kind, token, context ] = event; const { type, start, end } = token; const { "column": startColumn, "line": startLine } = start; const { "column": endColumn, "line": endLine } = end; const text = context.sliceSerialize(token); - if (kind === "enter") { + if ((kind === "enter") && !skipHtmlFlowChildren) { const previous = current; history.push(previous); current = { @@ -109,7 +133,11 @@ function micromarkParseWithOffset( text, "children": [] }; - if (current.type === "htmlFlow") { + previous.children.push(current); + flatTokens.push(current); + // @ts-ignore + if ((current.type === "htmlFlow") && !isHtmlFlowComment(current)) { + skipHtmlFlowChildren = true; if (!reparseOptions || !lines) { reparseOptions = { ...micromarkOptions, @@ -126,20 +154,25 @@ function micromarkParseWithOffset( const reparseMarkdown = lines .slice(current.startLine - 1, current.endLine) .join("\n"); - current.htmlFlowChildren = micromarkParseWithOffset( + const tokens = micromarkParseWithOffset( reparseMarkdown, reparseOptions, referencesDefined, current.startLine - 1 ); + current.children = tokens; + flatTokens.push(...tokens[flatTokensSymbol]); } - previous.children.push(current); - flatTokens.push(current); } else if (kind === "exit") { - Object.freeze(current.children); - Object.freeze(current); - // @ts-ignore - current = history.pop(); + if (type === "htmlFlow") { + skipHtmlFlowChildren = false; + } + if (!skipHtmlFlowChildren) { + Object.freeze(current.children); + Object.freeze(current); + // @ts-ignore + current = history.pop(); + } } } @@ -211,20 +244,6 @@ function filterByTypes(tokens, allowed) { return filterByPredicate(tokens, predicate); } -/** - * Filter a list of Micromark tokens for HTML tokens. - * - * @param {Token[]} tokens Micromark tokens. - * @returns {Token[]} Filtered tokens. - */ -function filterByHtmlTokens(tokens) { - return filterByPredicate( - tokens, - (token) => token.type === "htmlText", - (token) => token.htmlFlowChildren || token.children - ); -} - /** * Gets the heading level of a Micromark heading tokan. * @@ -318,7 +337,6 @@ function tokenIfType(token, type) { module.exports = { "parse": micromarkParse, - filterByHtmlTokens, filterByPredicate, filterByTypes, getHeadingLevel, diff --git a/lib/md032.js b/lib/md032.js index e95c136d..07d12dfb 100644 --- a/lib/md032.js +++ b/lib/md032.js @@ -46,7 +46,9 @@ module.exports = { const topLevelLists = filterByPredicate( parsers.micromark.tokens, isList, - (token) => (isList(token) ? [] : token.children) + (token) => ( + (isList(token) || (token.type === "htmlFlow")) ? [] : token.children + ) ); for (const list of topLevelLists) { diff --git a/lib/md033.js b/lib/md033.js index 08bbfbfe..54efce1a 100644 --- a/lib/md033.js +++ b/lib/md033.js @@ -3,7 +3,7 @@ "use strict"; const { addError } = require("../helpers"); -const { filterByHtmlTokens, getHtmlTagInfo } = +const { filterByTypes, getHtmlTagInfo } = require("../helpers/micromark.cjs"); const nextLinesRe = /[\r\n][\s\S]*$/; @@ -16,7 +16,8 @@ module.exports = { let allowedElements = params.config.allowed_elements; allowedElements = Array.isArray(allowedElements) ? allowedElements : []; allowedElements = allowedElements.map((element) => element.toLowerCase()); - for (const token of filterByHtmlTokens(params.parsers.micromark.tokens)) { + const { tokens } = params.parsers.micromark; + for (const token of filterByTypes(tokens, [ "htmlText" ])) { const htmlTagInfo = getHtmlTagInfo(token); if ( htmlTagInfo && diff --git a/lib/md037.js b/lib/md037.js index 9e8ba8d2..69842bb8 100644 --- a/lib/md037.js +++ b/lib/md037.js @@ -3,6 +3,7 @@ "use strict"; const { addError } = require("../helpers"); +const { filterByPredicate } = require("../helpers/micromark.cjs"); module.exports = { "names": [ "MD037", "no-space-in-emphasis" ], @@ -16,16 +17,11 @@ module.exports = { for (const marker of [ "_", "__", "___", "*", "**", "***" ]) { emphasisTokensByMarker.set(marker, []); } - const pending = [ ...parsers.micromark.tokens ]; - let token = null; - while ((token = pending.shift())) { - - // Use reparsed children of htmlFlow tokens - if (token.type === "htmlFlow") { - pending.unshift(...token.htmlFlowChildren); - continue; - } - pending.push(...token.children); + const tokens = filterByPredicate( + parsers.micromark.tokens, + (token) => token.children.some((child) => child.type === "data") + ); + for (const token of tokens) { // Build lists of bare tokens for each emphasis marker type for (const emphasisTokens of emphasisTokensByMarker.values()) { diff --git a/lib/md044.js b/lib/md044.js index 86318e4e..61bca9a4 100644 --- a/lib/md044.js +++ b/lib/md044.js @@ -29,27 +29,22 @@ module.exports = { const htmlElements = params.config.html_elements; const includeHtmlElements = (htmlElements === undefined) ? true : !!htmlElements; - const scannedTypes = new Set([ "data", "htmlFlowData" ]); + const scannedTypes = new Set([ "data" ]); if (includeCodeBlocks) { scannedTypes.add("codeFlowValue"); scannedTypes.add("codeTextData"); } + if (includeHtmlElements) { + scannedTypes.add("htmlFlowData"); + scannedTypes.add("htmlTextData"); + } const contentTokens = filterByPredicate( params.parsers.micromark.tokens, (token) => scannedTypes.has(token.type), - (token) => { - let { children } = token; - const { htmlFlowChildren, text, type } = token; - if (!includeHtmlElements && (type === "htmlFlow")) { - children = text.startsWith(" diff --git a/test/lists_without_blank_lines.md b/test/lists_without_blank_lines.md index f6b9daa9..f0f3dd35 100644 --- a/test/lists_without_blank_lines.md +++ b/test/lists_without_blank_lines.md @@ -74,7 +74,22 @@ code text +

+1. Not a +2. list +

+ +

1. Not a list

+ +

+* Not a +* list +

+ +

* Not a list

+ [\s\S]*$/; const ignoreFiles = new Set([ diff --git a/test/snapshots/markdownlint-test-micromark.mjs.md b/test/snapshots/markdownlint-test-micromark.mjs.md index 4aed6337..b090ce4f 100644 --- a/test/snapshots/markdownlint-test-micromark.mjs.md +++ b/test/snapshots/markdownlint-test-micromark.mjs.md @@ -2574,57 +2574,6 @@ Generated by [AVA](https://avajs.dev). }, { children: [ - { - children: [], - endColumn: 4, - endLine: 43, - startColumn: 1, - startLine: 43, - text: '

', - type: 'htmlFlowData', - }, - { - children: [], - endColumn: 1, - endLine: 44, - startColumn: 4, - startLine: 43, - text: `␊ - `, - type: 'lineEnding', - }, - { - children: [], - endColumn: 11, - endLine: 44, - startColumn: 1, - startLine: 44, - text: 'HTML block', - type: 'htmlFlowData', - }, - { - children: [], - endColumn: 1, - endLine: 45, - startColumn: 11, - startLine: 44, - text: `␊ - `, - type: 'lineEnding', - }, - { - children: [], - endColumn: 5, - endLine: 45, - startColumn: 1, - startLine: 45, - text: '

', - type: 'htmlFlowData', - }, - ], - endColumn: 5, - endLine: 45, - htmlFlowChildren: [ { children: [ { @@ -2717,6 +2666,8 @@ Generated by [AVA](https://avajs.dev). type: 'content', }, ], + endColumn: 5, + endLine: 45, startColumn: 1, startLine: 43, text: `

␊ @@ -3224,47 +3175,6 @@ Generated by [AVA](https://avajs.dev). ], endColumn: 35, endLine: 51, - htmlFlowChildren: [ - { - children: [ - { - children: [ - { - children: [ - { - children: [], - endColumn: 35, - endLine: 51, - startColumn: 1, - startLine: 51, - text: '', - type: 'htmlTextData', - }, - ], - endColumn: 35, - endLine: 51, - startColumn: 1, - startLine: 51, - text: '', - type: 'htmlText', - }, - ], - endColumn: 35, - endLine: 51, - startColumn: 1, - startLine: 51, - text: '', - type: 'paragraph', - }, - ], - endColumn: 35, - endLine: 51, - startColumn: 1, - startLine: 51, - text: '', - type: 'content', - }, - ], startColumn: 1, startLine: 51, text: '', diff --git a/test/snapshots/markdownlint-test-micromark.mjs.snap b/test/snapshots/markdownlint-test-micromark.mjs.snap index 7f03eeb0..a1c5d04d 100644 Binary files a/test/snapshots/markdownlint-test-micromark.mjs.snap and b/test/snapshots/markdownlint-test-micromark.mjs.snap differ diff --git a/test/snapshots/markdownlint-test-scenarios.js.md b/test/snapshots/markdownlint-test-scenarios.js.md index f7704462..9334323b 100644 --- a/test/snapshots/markdownlint-test-scenarios.js.md +++ b/test/snapshots/markdownlint-test-scenarios.js.md @@ -10917,6 +10917,14 @@ Generated by [AVA](https://avajs.dev). This \`is␊ also␊ very\` **bad** {MD050}␊ + ␊ +

HTML __should__ *be* ignored

␊ + ␊ +

␊ + HTML __should__ *be* ignored␊ +

␊ + ␊ + ␊ `, } @@ -30582,7 +30590,7 @@ Generated by [AVA](https://avajs.dev). insertText: `␊ `, }, - lineNumber: 83, + lineNumber: 98, ruleDescription: 'Files should end with a single newline character', ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md047.md', ruleNames: [ @@ -30679,7 +30687,22 @@ Generated by [AVA](https://avajs.dev). ␊ text␊ ␊ +

␊ + 1. Not a␊ + 2. list␊ +

␊ + ␊ +

1. Not a list

␊ + ␊ +

␊ + * Not a␊ + * list␊ +

␊ + ␊ +

* Not a list

␊ + ␊