this post was submitted on 30 Jul 2023
137 points (90.5% liked)
Technology
59593 readers
6512 users here now
This is a most excellent place for technology news and articles.
Our Rules
- Follow the lemmy.world rules.
- Only tech related content.
- Be excellent to each another!
- Mod approved content bots can post up to 10 articles per day.
- Threads asking for personal tech support may be deleted.
- Politics threads may be removed.
- No memes allowed as posts, OK to post as comments.
- Only approved bots from the list below, to ask if your bot can be added please contact us.
- Check for duplicates before posting, duplicates may be removed
Approved Bots
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
EDIT: seems it wont render ampersand correctly at all.. so the below is just has everything escaped when I didn't mean it to be and more confusing than it should be because of this... not sure how to get ampersand to display correctly in a code block, seems to be bugged.
&
is the HTML escape code for ~~&
~~ ampersand. As ~~&
~~ ampersand is a special character in HTML which means entity reference and should you can use the escaped form to get the browser to render just&
rather than treating it as a reference. The same goes for other characters like ~~<
~~ less than or>
etc. However a lot of browsers still treat ~~&
~~ ampersand as a literal in places where it does not look like a reference so the literal still works in a lot of places. But the escaped form always works.But when you copy html from a page your browser is probably copying the escaped form the page used in its source rather then the rendered form. It does this to let you get rich markup when pasting into documents - the app you paste into understands the html and knows when you are using heading or bolding text etc.
But in this case the app just pasted in the escaped form with no conversation. And for security reasons likely escaped it again as you don't want users to be able to post any old html formatting in a comment, so any html special characters in the input get escaped leaving you with a double escaped char, which the browser only unescapes one layer of when rendering.
Heh, well, look at that... seems it is also escaping chars inside backticks, but then not undoing that on the render when it conveys them to a pre tag... Which IMO seems like a bug in lemmy.
Let's test some things: &
\&
&
I typed: It previous as I would expect:
But renders it escaped on the mobile app at least, disappointing...