Skip to content

Commit

Permalink
disable reflinks in markdown - fixes #57
Browse files Browse the repository at this point in the history
  • Loading branch information
slatinsky committed Aug 17, 2024
1 parent 5b64aa3 commit 078144a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/dcef/frontend/src/js/markdownParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ export const rules = {
url: SimpleMarkdown.defaultRules.url,
link: SimpleMarkdown.defaultRules.link,
image: SimpleMarkdown.defaultRules.image,
reflink: SimpleMarkdown.defaultRules.reflink,
// reflink: SimpleMarkdown.defaultRules.reflink,
refimage: SimpleMarkdown.defaultRules.refimage,
em: SimpleMarkdown.defaultRules.em,
strong: SimpleMarkdown.defaultRules.strong,
Expand Down
2 changes: 1 addition & 1 deletion src/dcef/frontend/src/lib/message/MessageMarkdown.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
async function process(content: string, isOnline): void {
// TEST STRING (uncomment to test formatter):
// script is split up, because svelte tries to compile it
// content = `# heading\n## subheading\n### subsubheading\n#### subsubsubheading\n##### subsubsubsubheading\n###### subsubsubsubsubheading\nhello @Adam old mention\nhello <@627848643557663699> new mention\n<t:1543392060>\n<t:1543392060:f>\n<b>UNSAFE HTML</><sc` + `ript>alert('this should never run')</scr` + `ipt>\nhttps://discord.com/channels/869237470565392384/869240824142102558\nhttps://discord.com/channels/869237470565392384/869240824142102558/869243917961408552\n**bold** *italic* ***bold italic*** __underline__ ~~strikethrough~~ __***underline bold italic***__ __**underline bold**__ __*underline italic*__ __***underline bold italic***__ __~~underline strikethrough~~__ __~~**underline strikethrough bold**~~__ __~~*underline strikethrough italic*~~__\n\n- list item1\n- list item2\n - nested list item1\n- list item3\n\nhighlighted searchTerm1 searchTerm2 here\nnew <:kekw:782589696621805568> emoji\nnew <a:aPES_Blink:493677314735865856> animated emoji\nmentioned <@&878787663080666078> role`
// content = `# heading\n## subheading\n### subsubheading\n#### subsubsubheading\n##### subsubsubsubheading\n###### subsubsubsubsubheading\nhello @Adam old mention\nhello <@627848643557663699> new mention\n<t:1543392060>\n<t:1543392060:f>\n<b>UNSAFE HTML</><sc` + `ript>alert('this should never run')</scr` + `ipt>\nhttps://discord.com/channels/869237470565392384/869240824142102558\nhttps://discord.com/channels/869237470565392384/869240824142102558/869243917961408552\n**bold** *italic* ***bold italic*** __underline__ ~~strikethrough~~ __***underline bold italic***__ __**underline bold**__ __*underline italic*__ __***underline bold italic***__ __~~underline strikethrough~~__ __~~**underline strikethrough bold**~~__ __~~*underline strikethrough italic*~~__\n\n- list item1\n- list item2\n - nested list item1\n- list item3\n\nhighlighted searchTerm1 searchTerm2 here\nnew <:kekw:782589696621805568> emoji\nnew <a:aPES_Blink:493677314735865856> animated emoji\nmentioned <@&878787663080666078> role\n[this is not a link] [and this one is not a link too]\n[correct link](https://github.com/slatinsky/DiscordChatExporter-frontend)\nIs C# the best programming language?`
let parsed = parseMarkdown(content, {
searchTerms: terms,
Expand Down

0 comments on commit 078144a

Please sign in to comment.