mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-05 21:02:43 +00:00
@@ -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());
|
||||||
|
|||||||
Reference in New Issue
Block a user