Recently I noticed this edit. Here is an example section:
using a single mathematical operation is
4*(min(d4, 3)) - 8
, or in anydice terms4d{1,2,3,3} - 8
(or equivalently4d{-1,0,1,1}
was edited to:
using a single mathematical operation is 4*(min(d4, 3)) - 8, or in anydice terms 4d{1,2,3,3} - 8 (or equivalently 4d{-1,0,1,1})
KorvinStarmast's rationale for the edit was:
Nice answer, but in the future please don't use code blocks. They mess up a lot of screen readers. I replaced yours with italics.
(4d6k3 - 10) / 2
edited to:
(4d6k3 - 10) / 2
I'd like to discuss where the line is (even if fuzzy) for the use of code tags for dice syntax.
Previous discussions
I am not personally too familiar with screen readers, but I did find a couple previous discussions:
Inline Code Spans should not be used for emphasis, right?
SevenSidedDie:
Code formatting is semantic HTML to indicate to a parser that text is code. If we start lying to our parsers, we break tools built on HTML. Consider screen readers: if a visually impaired user configures their software to spell out code tags, or to have an easy keyboard shortcut with a macro called "jump to next code span/block and highlight" for easy copy-pasting, we are significantly disabling their ability to interact with the page. Further disabling, I should say.
How do I write an accessible Stack Exchange post?
Regarding italics:
Mithical:
According to the style guide for dyslexia, it looks like italics in general can make it harder to read, but it doesn't specifically point out stacking bold and italics. It advises using bold for emphasis but to avoid italics.
wizzwizz4:
@Mithical That advice might be good for dyslexia, but it's not generally applicable; bold also has problems. We can't do one-size-fits-all, so I tend to fall back to the HTML semantics, where
<strong>
is for importance,<b>
is for catching the eye,<em>
is for stress-emphasis in prose,<mark>
is for (emphasis mine), and<i>
is for most other stuff. In the distant future where computers actually work properly, you'll be able to configure your browser to map HTML's semantics to a presentation that works for your brain.
On screen readers:
wizzwizz4 again:
Btw I remember reading a complaint on mSO that
<code>
triggered some screen readers to spell the contents out (like CSSspeak-as: spell-out
, instead of the more sensibleliteral-punctuation
). Your bad alt text examples are clearer when presented in monospace (at least, to me), but they don't have code semantics. Considering you can't use CSS or aria attributes, I don't know what the right solution here is.
Laurel:
@wizzwizz4 "code triggered some screen readers to spell the contents out"—Correct, but I would expect most users to use the middle ground settings. For me, source code is spoken the same as regular text except all punctuation is spoken too, so it will pronounce words as words, not spell them out. If I did need something spelled out, I could switch to "character" mode instead of using "container" mode. (Maybe I should write a guide explaining how a person uses a screen reader?) Anyway, I think monospaced is appropriate for the examples, which are markdown code
Is there a functional purpose to putting things in code text here?
Top answer by SevenSidedDie:
Code formatting should never be used for non-code markup.
(Feel free to edit with any additional relevant prior discussions.)