Changing fencing on html blocks

Because *someone* had to use three pipes in their twitter display name
This commit is contained in:
Jocelyn Badgley (Twipped) 2020-03-06 19:30:48 -08:00
parent 6ae8f358a4
commit b9f82a7018
3 changed files with 8 additions and 7 deletions

View File

@ -31,7 +31,7 @@ const markdownEngines = {
permalinkSymbol: '<img src="/images/svg/paragraph.svg">', permalinkSymbol: '<img src="/images/svg/paragraph.svg">',
slugify, slugify,
}) })
.use(require('./lib/markdown-raw-html')), .use(require('./lib/markdown-raw-html'), { debug: false }),
preview: markdownIt({ preview: markdownIt({
html: false, html: false,
@ -45,7 +45,7 @@ function markdown (mode, input, env) {
input = input.replace(/\{!\{([\s\S]*?)\}!\}/mg, (match, contents) => { input = input.replace(/\{!\{([\s\S]*?)\}!\}/mg, (match, contents) => {
try { try {
const result = handlebars.compile(contents)(env); const result = handlebars.compile(contents)(env);
return '|||' + result + '|||'; return 'æææ' + result + 'æææ';
} catch (e) { } catch (e) {
log.error(e); log.error(e);
return ''; return '';
@ -55,7 +55,7 @@ function markdown (mode, input, env) {
if (mode === 'preview') { if (mode === 'preview') {
input = striptags(input input = striptags(input
.replace(/<!--\[[\s\S]*?\]-->/g, '') .replace(/<!--\[[\s\S]*?\]-->/g, '')
.replace(/|||[\s\S]*?|||/gi, ''), .replace(/æææ[\s\S]*?æææ/gi, ''),
).trim(); ).trim();
if (input.length > 1000) input = input.slice(0, 1000) + '…'; if (input.length > 1000) input = input.slice(0, 1000) + '…';
input = input ? markdownEngines[mode].render(input) : ''; input = input ? markdownEngines[mode].render(input) : '';

View File

@ -2,7 +2,7 @@
module.exports = exports = function (md, options) { module.exports = exports = function (md, options) {
options = { options = {
fence: '|||', fence: 'æææ',
...options, ...options,
}; };
@ -58,7 +58,8 @@ module.exports = exports = function (md, options) {
} }
if (startLine > state.discreteHtmlScan.line) { 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 }); 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.'); throw new Error('markdown-it-discrete-html encountered a parsing error.');
} }

View File

@ -2,7 +2,7 @@
> **Trans·gen·der** - *adjective* > **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. > 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. 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>æææ