Rendered headers do not call escape_text, so their text is treated
like HTML, such as its "feature" with ampersands.
Examples, source followed by explained result:
## Fun & games
This is rendered as nothing.
## Fun & games
This is rendered as `Fun & games` in H2 style.
## Fun " games
This is rendered as `Fun " games` in H2 style.
.
Regular text calls wrap_text which in turn calls escape_text. Headers,
though, do not end up calling escape_text at all.
https://git.sr.ht/~julienxx/castor/tree/master/item/src/draw.rs#L142
https://git.sr.ht/~julienxx/castor/tree/master/item/src/draw.rs#L68
Hope you can fix this. I can somewhat read Rust but I definitely can't
write it.
On 07/01/2021 14:55, Cadence Ember wrote:
> Rendered headers do not call escape_text, so their text is treated
> like HTML, such as its "feature" with ampersands.
>
> Examples, source followed by explained result:
>
> ## Fun & games
>
> This is rendered as nothing.
>
> ## Fun & games
>
> This is rendered as `Fun & games` in H2 style.
>
> ## Fun " games
>
> This is rendered as `Fun " games` in H2 style.
>
> .
>
> Regular text calls wrap_text which in turn calls escape_text. Headers,
> though, do not end up calling escape_text at all.
>
> https://git.sr.ht/~julienxx/castor/tree/master/item/src/draw.rs#L142
> https://git.sr.ht/~julienxx/castor/tree/master/item/src/draw.rs#L68
>
> Hope you can fix this. I can somewhat read Rust but I definitely can't
> write it.
>
Good catch, thanks! This will be fixed in the next few minutes.
--
julienxx