~julienxx/castor

1

Header text is interpreted as HTML

Details
Message ID
<20210108025532.2dbc5894e8525e6ddcc78980@disroot.org>
DKIM signature
pass
Download raw message
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 &amp; games

This is rendered as `Fun & games` in H2 style.

## Fun &quot; 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.
Details
Message ID
<763454ff-0792-9bc4-445f-5e23fc18f90b@typed-hole.org>
In-Reply-To
<20210108025532.2dbc5894e8525e6ddcc78980@disroot.org> (view parent)
DKIM signature
permerror
Download raw message
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 &amp; games
> 
> This is rendered as `Fun & games` in H2 style.
> 
> ## Fun &quot; 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
Reply to thread Export thread (mbox)