Update markdownlint-micromark dependency to 0.1.7, incorporate micromark-extension-math into parse (and compile for demo page).

This commit is contained in:
David Anson 2023-07-16 22:07:34 -07:00
parent de2922a8eb
commit 3945de161e
4 changed files with 15 additions and 6 deletions

View file

@ -44,7 +44,8 @@
"extensions": [ "extensions": [
micromark.gfmAutolinkLiteral(), micromark.gfmAutolinkLiteral(),
micromark.gfmFootnote(), micromark.gfmFootnote(),
micromark.gfmTable() micromark.gfmTable(),
micromark.math()
] ]
}; };
const context = micromark.parse(parseOptions); const context = micromark.parse(parseOptions);
@ -55,7 +56,8 @@
"htmlExtensions": [ "htmlExtensions": [
micromarkHtml.gfmAutolinkLiteralHtml(), micromarkHtml.gfmAutolinkLiteralHtml(),
micromarkHtml.gfmFootnoteHtml(), micromarkHtml.gfmFootnoteHtml(),
micromarkHtml.gfmTableHtml() micromarkHtml.gfmTableHtml(),
micromarkHtml.mathHtml()
] ]
}; };
return micromarkHtml.compile(compileOptions)(events); return micromarkHtml.compile(compileOptions)(events);

View file

@ -1364,6 +1364,7 @@ var _require = __webpack_require__(/*! markdownlint-micromark */ "markdownlint-m
gfmAutolinkLiteral = _require.gfmAutolinkLiteral, gfmAutolinkLiteral = _require.gfmAutolinkLiteral,
gfmFootnote = _require.gfmFootnote, gfmFootnote = _require.gfmFootnote,
gfmTable = _require.gfmTable, gfmTable = _require.gfmTable,
math = _require.math,
parse = _require.parse, parse = _require.parse,
postprocess = _require.postprocess, postprocess = _require.postprocess,
preprocess = _require.preprocess; preprocess = _require.preprocess;
@ -1394,7 +1395,7 @@ function getMicromarkEvents(markdown) {
var refsDefined = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; var refsDefined = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
// Customize options object to add useful extensions // Customize options object to add useful extensions
options.extensions = options.extensions || []; options.extensions = options.extensions || [];
options.extensions.push(gfmAutolinkLiteral(), gfmFootnote(), gfmTable()); options.extensions.push(gfmAutolinkLiteral(), gfmFootnote(), gfmTable(), math());
// Use micromark to parse document into Events // Use micromark to parse document into Events
var encoding = undefined; var encoding = undefined;

View file

@ -4,7 +4,8 @@
// @ts-ignore // @ts-ignore
const { const {
gfmAutolinkLiteral, gfmFootnote, gfmTable, parse, postprocess, preprocess gfmAutolinkLiteral, gfmFootnote, gfmTable, math, parse, postprocess,
preprocess
// @ts-ignore // @ts-ignore
} = require("markdownlint-micromark"); } = require("markdownlint-micromark");
@ -33,7 +34,12 @@ function getMicromarkEvents(markdown, options = {}, refsDefined = true) {
// Customize options object to add useful extensions // Customize options object to add useful extensions
options.extensions = options.extensions || []; options.extensions = options.extensions || [];
options.extensions.push(gfmAutolinkLiteral(), gfmFootnote(), gfmTable()); options.extensions.push(
gfmAutolinkLiteral(),
gfmFootnote(),
gfmTable(),
math()
);
// Use micromark to parse document into Events // Use micromark to parse document into Events
const encoding = undefined; const encoding = undefined;

View file

@ -65,7 +65,7 @@
}, },
"dependencies": { "dependencies": {
"markdown-it": "13.0.1", "markdown-it": "13.0.1",
"markdownlint-micromark": "0.1.6" "markdownlint-micromark": "0.1.7"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "7.22.9", "@babel/core": "7.22.9",