mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-30 04:32:38 +00:00
commit changes so far
This commit is contained in:
@@ -527,6 +527,21 @@ const definitionListsMultiLine = {
|
||||
}
|
||||
};
|
||||
|
||||
const pageBreak = {
|
||||
name : 'pageBreak',
|
||||
level : 'block',
|
||||
start(src) { return src.match(/\n\\page/m)?.index; }, // Hint to Marked.js to stop and check for a match
|
||||
tokenizer(src) {
|
||||
const regex = /^\\page(?:$|(?={[^\n{}]+}$))/m;
|
||||
const match = regex.exec(src);
|
||||
if(match?.length)
|
||||
return { type : 'pageBreak', raw : match[0] };
|
||||
},
|
||||
renderer(token) {
|
||||
return `<pagebreak></pagebreak>\n`;
|
||||
}
|
||||
};
|
||||
|
||||
//v=====--------------------< Variable Handling >-------------------=====v// 242 lines
|
||||
const replaceVar = function(input, hoist=false, allowUnresolved=false) {
|
||||
const regex = /([!$]?)\[((?!\s*\])(?:\\.|[^\[\]\\])+)\]/g;
|
||||
@@ -795,7 +810,7 @@ const tableTerminators = [
|
||||
];
|
||||
|
||||
Marked.use(MarkedVariables());
|
||||
Marked.use({ extensions : [justifiedParagraphs, definitionListsMultiLine, definitionListsSingleLine, forcedParagraphBreaks,
|
||||
Marked.use({ extensions : [pageBreak, justifiedParagraphs, definitionListsMultiLine, definitionListsSingleLine, forcedParagraphBreaks,
|
||||
nonbreakingSpaces, superSubScripts, mustacheSpans, mustacheDivs, mustacheInjectInline] });
|
||||
Marked.use(mustacheInjectBlock);
|
||||
Marked.use({ renderer: renderer, tokenizer: tokenizer, mangle: false });
|
||||
@@ -992,6 +1007,8 @@ const Markdown = {
|
||||
|
||||
return errors;
|
||||
},
|
||||
|
||||
extractHTMLStyleTags : extractHTMLStyleTags
|
||||
};
|
||||
|
||||
export default Markdown;
|
||||
|
||||
Reference in New Issue
Block a user