0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-05 21:02:43 +00:00

Revert "Simple Underline token."

This reverts commit 04187cf769.
This commit is contained in:
David Bolack
2024-01-18 09:51:14 -06:00
parent ac9fc720f7
commit 0c6c9fce4d

View File

@@ -239,24 +239,9 @@ const underline = {
level : 'inline', level : 'inline',
start(src) { return src.match(/\w_[^_]_/m)?.index;}, start(src) { return src.match(/\w_[^_]_/m)?.index;},
tokenizer(src, tokens) { tokenizer(src, tokens) {
const uRegex = /^_([^_]*)_/m; const uRegex = /^_(?!\s)(?=([^_]*[^\s]))\1\^/m;
const match = uRegex.exec(src);
console.log('Looking');
if(match?.length) {
console.log('found!');
console.log(match);
return {
type : 'underline',
raw : match[0],
tokens : this.lexer.inlineTokens(match[1])
};
}
},
renderer(token) {
console.log()
return `<u>${this.parser.parseInline(token.tokens)}</u>`;
} }
}; }
const definitionLists = { const definitionLists = {
name : 'definitionLists', name : 'definitionLists',
@@ -290,7 +275,7 @@ const definitionLists = {
} }
}; };
Marked.use({ extensions: [mustacheSpans, mustacheDivs, mustacheInjectInline, definitionLists, superSubScripts, underline] }); Marked.use({ extensions: [mustacheSpans, mustacheDivs, mustacheInjectInline, definitionLists, superSubScripts] });
Marked.use(mustacheInjectBlock); Marked.use(mustacheInjectBlock);
Marked.use({ renderer: renderer, mangle: false }); Marked.use({ renderer: renderer, mangle: false });
Marked.use(MarkedExtendedTables(), MarkedGFMHeadingId(), MarkedSmartypantsLite()); Marked.use(MarkedExtendedTables(), MarkedGFMHeadingId(), MarkedSmartypantsLite());