clragon / swan

bring elegance to your flutter discussions
https://discord.gg/rflutterdev
MIT License
3 stars 0 forks source link

handle weird text files in pastebin upload #8

Open clragon opened 10 months ago

clragon commented 10 months ago

if you paste a really long text into the input in discord, it will turn into a text file automatically. this is really annoying because it ruins our pastebin uploads. for example:

some preamble about my problem

\```dart
a really long piece of code
\```

this entire text will end up in the file, including the text block, which then breaks syntax highlighting. it would be nice if we somehow detected this and threw away any text outside the code block.

however, we should be careful about this and only do it if it actually contains a single code block, maybe even an open one, since the ending backticks might not be included.