I want to render some text, like from <span class="divided">ABCD</span>
to A | B | C | D
.
' | '
should not be rendered as a normal text because it would lower the screen-reader accessibility.
Maybe I could do this with JavaScript, like
- split the text
- join them with
<span class="divider">
, where.dividier:not(:last-child)::after { content: ' | '; }
- apply the result
But I think it's not a good way. I don't want to change the html itself.
Would it be possible only with CSS?