0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-28 09:12:45 +00:00

Add migrate nav item to pages and update migrate document

This commit is contained in:
Charlie Humphreys
2021-12-15 23:57:52 -06:00
parent f1c4910993
commit fd23396b95
10 changed files with 233 additions and 193 deletions

View File

@@ -535,24 +535,7 @@ module.exports = {
marked : Markdown,
render : (rawBrewText)=>{
rawBrewText = rawBrewText.replace(/^\\column$/gm, `\n<div class='columnSplit'></div>\n`)
.replace(/^(:+)$/gm, (match, _, i)=>{
let test, matches=[];
const codeBlock = /`/gm, inlineCodeBlock = /[^`]`[^`]/g;
while (test = codeBlock.exec(rawBrewText)) {
matches.push(test);
}
// console.log(match, m, i, indexes);
if(matches.filter((m)=>m.index < i).length % 2 !== 0) return match;
// matches = [];
// while (test = inlineCodeBlock.exec(rawBrewText)) {
// matches.push(test);
// }
// console.log(matches, match, i);
// if(matches.filter((m)=>m.index < i).length % 2 !== 0) return match;
return `${`<div class='blank'></div>`.repeat(match.length)}\n`;
});
.replace(/^(:+)$/gm, (match)=>`${`<div class='blank'></div>`.repeat(match.length)}\n`);
return Markdown(
sanatizeScriptTags(rawBrewText),
{ renderer: renderer }