Underscores being used for formatting/markdown is causing some text issues

Opmerkingen

3 opmerkingen

  • Athanasius

    Discord is erroneously triggering italics from underscores **anywhere** in text, rather than only after a word boundary.

    I'm running into this when sending things like:

     

    ```md
    talking about some code with a snake_case() function```

    It switches to italics from `case()...` onwards until the next underscore.  It plain shouldn't be triggering off the underscore mid-word.

    1
  • Xia

    I use discord for gaming (of course) however some of my usernames or gamer tags have an underscore in my name. When I have tried to remove text formatting so that my username is not italicized when applying for membership on some servers that relate to my games it does NOT work. You need to have an easier way for gamers to click a button and let us use underscores in things like usernames! It is infuriatingly stupid that I have to go over and over trying to tell a person how to spell my username rather than them just being able to read it and copy it properly. >:(

    1
  • Leyn

    Yes, I prefer asterisks, as underscores are also common in programming so when I explain stuff to another developer I must remember to surround all my file and variable names with `` (backtick) to show them “verbatim”. While good practice, sometimes I just want to write something quickly and not want to have all my text in italics because of one variable_name.

    Technically for this case, underscores are not the problem but rather Discord's implementation of Markdown which doesn't prevent "intraword emphasis". This specification https://spec.commonmark.org/0.31.2/#emphasis-and-strong-emphasis mentions that most implementations ignore intraword underscores, only consider intraword asterisks like a*b*c, specifically for such names.

    So excluding intraword underscores would solve many issues, although edge cases would remain, such as having a word starting with underscore and another ending with one (to take Xia's example of gamertags: “In my team there are _Alpha and Beta64_” => would need to write “In my team there are `_Alpha` and `Beta64_`”).

    Plus a bug causes the preview to be inconsistent with the actual view when combining underscores and backtick. For instance, in “a_b TEXT IN ITALICS `c_` ALL FURTHER TEXT AS CODE”, the preview shows the underscore inside backtick will stop italics (incorrect), whereas the actual view will turn all text after the last backtick as code (also incorrect).

    That's another issue though, which also happens with asterisk `*`, so I will report it separately.

    0

U moet u aanmelden om een opmerking te plaatsen.