diff --git a/assets/js/script.js b/assets/js/script.js index d8b8f9f..698aad7 100644 --- a/assets/js/script.js +++ b/assets/js/script.js @@ -439,10 +439,6 @@ addEventListener('DOMContentLoaded', () => { .replace(/__(.+?)__/g, '$1') .replace(/\*(.+?)\*/g, '$1') .replace(/_(.+?)_/g, '$1') - //headings - .replace(/^# (.*)$/gm, '

$1

') - .replace(/^## (.*)$/gm, '

$1

') - .replace(/^### (.*)$/gm, '

$1

') // Replace >>> and > with block-quotes. > is HTML code for > .replace(/^(?: *>>> ([\s\S]*))|(?:^ *>(?!>>) +.+\n)+(?:^ *>(?!>>) .+\n?)+|^(?: *>(?!>>) ([^\n]*))(\n?)/mg, (all, match1, match2, newLine) => { return `
${match1 || match2 || newLine ? match1 || match2 : all.replace(/^ *> /gm, '')}
`; @@ -470,6 +466,10 @@ addEventListener('DOMContentLoaded', () => { // Inline code txt = txt.replace(/`([^`]+?)`|``([^`]+?)``/g, (m, x, y, z) => x ? `${x}` : y ? `${y}` : z ? `${z}` : m) } + + txt = txt.replace(/^# (.*)$/gm, '

$1

') + .replace(/^## (.*)$/gm, '

$1

') + .replace(/^### (.*)$/gm, '

$1

') return txt; }