Situation: I have to force line-breaks in a heading.
The quick brown fox
jumps over the lazy dog
I can do <h1>The quick brown fox<br/> jumps over the lazy dog</h1>
, but a screen-reader will interpret it as "heading level 1, 2 items". Is there a way for the screen reader to not read it?
I have this solution:
<h1 aria-hidden="true">The quick brown fox<br/> jumps over the lazy dog</h1>
<h1 class="sr-only">The quick brown fox jumps over the lazy dog</h1>
2 HTML elements, one for "doing a line break for non-visually impaired users", and one for "not doing a line break for non-visually impaired users". Is there a better approach here?