// welcome to the shitty temporary file for managing the bbcode/markdown/whatever button const MszParsing = (() => { const defineTag = (name, open, close, summary, icon) => { return { name: name, open: open, close: close, summary: summary, icon: icon, }; }; const bbTags = [ defineTag('bb-bold', '[b]', '[/b]', 'Bold [b][/b]', 'fas fa-bold fa-fw'), defineTag('bb-italic', '[i]', '[/i]', 'Italic [i][/i]', 'fas fa-italic fa-fw'), defineTag('bb-underline', '[u]', '[/u]', 'Underline [u][/u]', 'fas fa-underline fa-fw'), defineTag('bb-strike', '[s]', '[/s]', 'Strikethrough [s][/s]', 'fas fa-strikethrough fa-fw'), defineTag('bb-link', '[url=]', '[/url]', 'Link [url][/url] or [url=][/url]', 'fas fa-link fa-fw'), defineTag('bb-image', '[img]', '[/img]', 'Image [img][/img]', 'fas fa-image fa-fw'), defineTag('bb-audio', '[audio]', '[/audio]', 'Audio [audio][/audio]', 'fas fa-music fa-fw'), defineTag('bb-video', '[video]', '[/video]', 'Video [video][/video]', 'fas fa-video fa-fw'), defineTag('bb-code', '[code]', '[/code]', 'Code [code][/code]', 'fas fa-code fa-fw'), defineTag('bb-zalgo', '[zalgo]', '[/zalgo]', 'Zalgo [zalgo][/zalgo]', 'fas fa-frog fa-fw'), ]; const mdTags = [ defineTag('md-bold', '**', '**', 'Bold ****', 'fas fa-bold fa-fw'), defineTag('md-italic', '*', '*', 'Italic ** or __', 'fas fa-italic fa-fw'), defineTag('md-underline', '__', '__', 'Underline ____', 'fas fa-underline fa-fw'), defineTag('md-strike', '~~', '~~', 'Strikethrough ~~~~', 'fas fa-strikethrough fa-fw'), defineTag('md-link', '[](', ')', 'Link []()', 'fas fa-link fa-fw'), defineTag('md-image', '![](', ')', 'Image ![]()', 'fas fa-image fa-fw'), defineTag('md-audio', '![](', ')', 'Audio ![]()', 'fas fa-music fa-fw'), defineTag('md-video', '![](', ')', 'Video ![]()', 'fas fa-video fa-fw'), defineTag('md-code', '```', '```', 'Code `` or ``````', 'fas fa-code fa-fw'), ]; const getTagsFor = parser => { if(typeof parser !== 'number') parser = parseInt(parser); if(parser === 1) return bbTags; if(parser === 2) return mdTags; return []; }; return { getTagsFor: getTagsFor, getTagsForPlainText: () => getTagsFor(0), getTagsForBBcode: () => getTagsFor(1), getTagsForMarkdown: () => getTagsFor(2), }; })();