From b9f82a7018461311b30cc6f18800b21a3f6c005e Mon Sep 17 00:00:00 2001 From: "Jocelyn Badgley (Twipped)" <joc@twipped.com> Date: Fri, 6 Mar 2020 19:30:48 -0800 Subject: [PATCH] Changing fencing on html blocks Because *someone* had to use three pipes in their twitter display name --- build/engines.js | 6 +++--- build/lib/markdown-raw-html.js | 5 +++-- public/_index-copy.md | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/build/engines.js b/build/engines.js index 1cf5c02..f4f8c2a 100644 --- a/build/engines.js +++ b/build/engines.js @@ -31,7 +31,7 @@ const markdownEngines = { permalinkSymbol: '<img src="/images/svg/paragraph.svg">', slugify, }) - .use(require('./lib/markdown-raw-html')), + .use(require('./lib/markdown-raw-html'), { debug: false }), preview: markdownIt({ html: false, @@ -45,7 +45,7 @@ function markdown (mode, input, env) { input = input.replace(/\{!\{([\s\S]*?)\}!\}/mg, (match, contents) => { try { const result = handlebars.compile(contents)(env); - return '|||' + result + '|||'; + return 'æææ' + result + 'æææ'; } catch (e) { log.error(e); return ''; @@ -55,7 +55,7 @@ function markdown (mode, input, env) { if (mode === 'preview') { input = striptags(input .replace(/<!--\[[\s\S]*?\]-->/g, '') - .replace(/|||[\s\S]*?|||/gi, ''), + .replace(/æææ[\s\S]*?æææ/gi, ''), ).trim(); if (input.length > 1000) input = input.slice(0, 1000) + '…'; input = input ? markdownEngines[mode].render(input) : ''; diff --git a/build/lib/markdown-raw-html.js b/build/lib/markdown-raw-html.js index ea7cec4..63a0b41 100644 --- a/build/lib/markdown-raw-html.js +++ b/build/lib/markdown-raw-html.js @@ -2,7 +2,7 @@ module.exports = exports = function (md, options) { options = { - fence: '|||', + fence: 'æææ', ...options, }; @@ -58,7 +58,8 @@ module.exports = exports = function (md, options) { } if (startLine > state.discreteHtmlScan.line) { - // we dun fucked up + // we dun fucked up, rescan + scanAhead(state, startLine, pos); debug('We somehow got ahead of ourselves', { startLine, line: state.discreteHtmlScan.line, lastLine, pos, endOfLine, tokens: state.tokens }); throw new Error('markdown-it-discrete-html encountered a parsing error.'); } diff --git a/public/_index-copy.md b/public/_index-copy.md index 868452b..b826025 100644 --- a/public/_index-copy.md +++ b/public/_index-copy.md @@ -2,7 +2,7 @@ > **Trans·gen·der** - *adjective* > Denoting or relating to a person whose sense of personal identity and gender does not correspond with their sex assigned at birth. -|||<div class="copy markup">||| +æææ<div class="copy markup">æææ For as long as human civilization has existed, [there have been people](https://en.wikipedia.org/wiki/Transgender_history) whose experience of their internal gender does not align with the physical features of their body. The Gala, a middle gender priest class of the Sumerian empire, exited over four thousand five hundred years ago. The indigenous cultures of North America recognized [a third gender](https://en.wikipedia.org/wiki/Third_gender) far before European colonialism, and still do to this day. Roman emperor Elagabalus (218 AD) insisted on being referred to as Lady rather than Lord, and even put forward a ransom for anyone who could conduct genital reconstruction surgery. @@ -20,4 +20,4 @@ The purpose of this site is to document the many ways that Gender Dysphoria mani -|||</div>||| +æææ</div>æææ