Reimplement inlineCodeSpanRanges as codeBlockAndSpanRanges to fix an issue with unterminated code spans (and for flexibility).

This commit is contained in:
David Anson 2021-11-23 04:40:05 +00:00 committed by GitHub
parent 9c60343692
commit 1e82f76596
12 changed files with 178 additions and 71 deletions

View file

@ -2,6 +2,14 @@
"use strict";
let codeBlockAndSpanRanges = null;
module.exports.codeBlockAndSpanRanges = (value) => {
if (value) {
codeBlockAndSpanRanges = value;
}
return codeBlockAndSpanRanges;
};
let flattenedLists = null;
module.exports.flattenedLists = (value) => {
if (value) {
@ -10,14 +18,6 @@ module.exports.flattenedLists = (value) => {
return flattenedLists;
};
let inlineCodeSpanRanges = null;
module.exports.inlineCodeSpanRanges = (value) => {
if (value) {
inlineCodeSpanRanges = value;
}
return inlineCodeSpanRanges;
};
let lineMetadata = null;
module.exports.lineMetadata = (value) => {
if (value) {
@ -27,7 +27,7 @@ module.exports.lineMetadata = (value) => {
};
module.exports.clear = () => {
codeBlockAndSpanRanges = null;
flattenedLists = null;
inlineCodeSpanRanges = null;
lineMetadata = null;
};