DiscordWebsite / Txt

View .txt files that have been uploaded to Discord
https://txt.discord.website
Apache License 2.0
6 stars 8 forks source link

Support for Quotes and Spoiler #5

Open Andre601 opened 3 years ago

Andre601 commented 3 years ago

I've created a TXT file to quickly check what this site actually renders and what not. https://txt.discord.website/?txt=584040473186926623%2F804397205729312848%2Fexample

From this test does it look like that it currently doesn't render Quotes and Spoilers. While Spoilers are a Discord thing, quote more often than not is a part of default markdown, which makes it really odd, that it isn't a part of the markdown js used here.

Perhaps it's also caused by some weird handling in the custom.js?

One thing I noticed is, that the Copyright C at the bottom is rendered differently when viewing a page than the default page, which I assume is caued by the renderer parsing the unicode using Tweemoji, when viewing a file, so perhaps this should be improved too.

And as a final note, would it be difficult to implement syntax highlighting? I can imagine it being somewhat tough to do, but it could be beneficial to have here.

jagrosh commented 3 years ago

Markdown formatting is handled by simple markdown; using an updated version may rectify the lack of quotes and spoilers.

The copyright icon is indeed being affected by twemoji (https://github.com/DiscordWebsite/Txt/blob/master/js/custom.js#L54), and this could likely be fixed by parsing only a subset of the page instead of the entire body.

By syntax highlighting, I'm assuming you mean in codeblocks? If so, https://highlightjs.org/ may be a good place to start, as I believe Discord uses a modified version of it.

Andre601 commented 3 years ago

Looks like the site broke all of a sudden. Perhaps Discord has recently changed stuff breaking it?