Skip to content

Commit

Permalink
Update micromark code and tests for prior commit updating markdownlin…
Browse files Browse the repository at this point in the history
…t-micromark (including micromark to 3.2.0).
  • Loading branch information
DavidAnson committed Jun 1, 2023
1 parent de02503 commit 22dc6ca
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 18 deletions.
7 changes: 1 addition & 6 deletions demo/markdownlint-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1380,12 +1380,7 @@ function micromarkParse(markdown) {
startLine = start["line"];
var endColumn = end["column"],
endLine = end["line"];
var text = null;
try {
text = context.sliceSerialize(token);
} catch (_unused) {
// https://github.com/micromark/micromark/issues/131
}
var text = context.sliceSerialize(token);
if (kind === "enter") {
var previous = current;
history.push(previous);
Expand Down
7 changes: 1 addition & 6 deletions helpers/micromark.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,7 @@ function micromarkParse(markdown, options = {}, refsDefined = true) {
const { type, start, end } = token;
const { "column": startColumn, "line": startLine } = start;
const { "column": endColumn, "line": endLine } = end;
let text = null;
try {
text = context.sliceSerialize(token);
} catch {
// https://github.com/micromark/micromark/issues/131
}
const text = context.sliceSerialize(token);
if (kind === "enter") {
const previous = current;
history.push(previous);
Expand Down
12 changes: 6 additions & 6 deletions test/snapshots/markdownlint-test-micromark.mjs.md
Original file line number Diff line number Diff line change
Expand Up @@ -1628,15 +1628,15 @@ Generated by [AVA](https://avajs.dev).
endLine: 21,
startColumn: 3,
startLine: 21,
text: null,
text: '',
type: 'blockQuote',
},
],
endColumn: 11,
endLine: 21,
startColumn: 1,
startLine: 20,
text: null,
text: '',
type: 'blockQuote',
},
{
Expand Down Expand Up @@ -1974,15 +1974,15 @@ Generated by [AVA](https://avajs.dev).
endLine: 28,
startColumn: 3,
startLine: 25,
text: null,
text: '',
type: 'listUnordered',
},
],
endColumn: 12,
endLine: 28,
startColumn: 1,
startLine: 23,
text: null,
text: '',
type: 'listUnordered',
},
{
Expand Down Expand Up @@ -2347,15 +2347,15 @@ Generated by [AVA](https://avajs.dev).
endLine: 35,
startColumn: 4,
startLine: 32,
text: null,
text: '',
type: 'listOrdered',
},
],
endColumn: 14,
endLine: 35,
startColumn: 1,
startLine: 30,
text: null,
text: '',
type: 'listOrdered',
},
{
Expand Down
Binary file modified test/snapshots/markdownlint-test-micromark.mjs.snap
Binary file not shown.

0 comments on commit 22dc6ca

Please sign in to comment.