Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Codidact Meta!

Codidact Meta is the meta-discussion site for the Codidact community network and the Codidact software. Whether you have bug reports or feature requests, support questions or rule discussions that touch the whole network – this is the site for you.

Post History

60%
+1 −0
Q&A HTML entities & the question content preview [duplicate]

An ampersand shows as &amp; instead of & in the following question content preview: I've also included an ampersand in the title of this question to test whether the title is also affect...

0 answers  ·  posted 1y ago by trichoplax‭  ·  closed as duplicate 1y ago by Monica Cellio‭

#5: Question closed by user avatar Monica Cellio‭ · 2023-01-09T13:41:49Z (over 1 year ago)
#4: Post edited by user avatar trichoplax‭ · 2023-01-07T12:53:14Z (over 1 year ago)
Replace outdated question image
  • An ampersand shows as `&amp;` instead of `&` in the following question content preview:
  • ![A question content preview with an HTML entity instead of an ampersand](https://meta.codidact.com/uploads/0007e02sury31hdl0587ssjbepxc)
  • I've also included an ampersand in the title of this question to test whether the title is also affected in the question preview. As can be seen on the front page, the ampersand in the question preview title displays correctly, so it is only the content preview that has this problem:
  • ![A question preview with an ampersand in the title but an HTML entity in the content preview](https://meta.codidact.com/uploads/4oc55efjjt8m02ze4de895z1pwcy)
  • An ampersand shows as `&amp;` instead of `&` in the following question content preview:
  • ![A question content preview with an HTML entity instead of an ampersand](https://meta.codidact.com/uploads/0007e02sury31hdl0587ssjbepxc)
  • I've also included an ampersand in the title of this question to test whether the title is also affected in the question preview. As can be seen on the front page, the ampersand in the question preview title displays correctly, so it is only the content preview that has this problem:
  • ![A question preview with an ampersand in the title but an HTML entity in the content preview](https://meta.codidact.com/uploads/9w66b4q4d1ctfit0ubxz7ffff2hg)
#3: Post edited by user avatar trichoplax‭ · 2023-01-07T12:51:10Z (over 1 year ago)
Rewrite having realised this is not a general HTML entities problem
  • In addition to [HTML entities not rendering in titles](https://meta.codidact.com/posts/281766), the content preview on the front page also shows raw HTML entities rather than their rendered characters.
  • An ampersand shows as `&amp;` instead of `&` in the following question content preview:
  • ![A question content preview with an HTML entity instead of an ampersand](https://meta.codidact.com/uploads/0007e02sury31hdl0587ssjbepxc)
  • The question linked above (about entities in titles) has an answer that suggests pasting in the character direct rather than using an HTML entity. This workaround works for uncommon characters not available from a particular regional keyboard, such as pasting in ℵ directly instead of typing `&aleph;` (the example given in that question). However, in the image above the ampersand was typed directly, and only converted into an HTML entity upon saving. This means the workaround cannot be used.
  • Is this enough reason to consider rendering HTML entities in question content previews (and possibly titles too)?
  • Alternatively, should this just be considered a more limited scope bug that only affects characters like ampersand that are automatically converted back to HTML entities preventing the workaround from working? Should a fix only consider such characters, like `&lt;` (<), `&gt;` (>), and `&amp;` (&)?
  • An ampersand shows as `&amp;` instead of `&` in the following question content preview:
  • ![A question content preview with an HTML entity instead of an ampersand](https://meta.codidact.com/uploads/0007e02sury31hdl0587ssjbepxc)
  • I've also included an ampersand in the title of this question to test whether the title is also affected in the question preview. As can be seen on the front page, the ampersand in the question preview title displays correctly, so it is only the content preview that has this problem:
  • ![A question preview with an ampersand in the title but an HTML entity in the content preview](https://meta.codidact.com/uploads/4oc55efjjt8m02ze4de895z1pwcy)
#2: Post edited by user avatar trichoplax‭ · 2023-01-07T12:44:50Z (over 1 year ago)
Shorten intro to test ampersand in this particular question's preview
  • In addition to [HTML entities not rendering in titles](https://meta.codidact.com/posts/281766), the content preview on the front page also shows raw HTML entities rather than their rendered characters.
  • For example, an ampersand shows as `&amp;` instead of `&` in the following question content preview:
  • ![A question content preview with an HTML entity instead of an ampersand](https://meta.codidact.com/uploads/0007e02sury31hdl0587ssjbepxc)
  • The question linked above (about entities in titles) has an answer that suggests pasting in the character direct rather than using an HTML entity. This workaround works for uncommon characters not available from a particular regional keyboard, such as pasting in ℵ directly instead of typing `&aleph;` (the example given in that question). However, in the image above the ampersand was typed directly, and only converted into an HTML entity upon saving. This means the workaround cannot be used.
  • Is this enough reason to consider rendering HTML entities in question content previews (and possibly titles too)?
  • Alternatively, should this just be considered a more limited scope bug that only affects characters like ampersand that are automatically converted back to HTML entities preventing the workaround from working? Should a fix only consider such characters, like `&lt;` (<), `&gt;` (>), and `&amp;` (&)?
  • In addition to [HTML entities not rendering in titles](https://meta.codidact.com/posts/281766), the content preview on the front page also shows raw HTML entities rather than their rendered characters.
  • An ampersand shows as `&amp;` instead of `&` in the following question content preview:
  • ![A question content preview with an HTML entity instead of an ampersand](https://meta.codidact.com/uploads/0007e02sury31hdl0587ssjbepxc)
  • The question linked above (about entities in titles) has an answer that suggests pasting in the character direct rather than using an HTML entity. This workaround works for uncommon characters not available from a particular regional keyboard, such as pasting in ℵ directly instead of typing `&aleph;` (the example given in that question). However, in the image above the ampersand was typed directly, and only converted into an HTML entity upon saving. This means the workaround cannot be used.
  • Is this enough reason to consider rendering HTML entities in question content previews (and possibly titles too)?
  • Alternatively, should this just be considered a more limited scope bug that only affects characters like ampersand that are automatically converted back to HTML entities preventing the workaround from working? Should a fix only consider such characters, like `&lt;` (<), `&gt;` (>), and `&amp;` (&)?
#1: Initial revision by user avatar trichoplax‭ · 2023-01-07T12:43:37Z (over 1 year ago)
HTML entities & the question content preview
In addition to [HTML entities not rendering in titles](https://meta.codidact.com/posts/281766), the content preview on the front page also shows raw HTML entities rather than their rendered characters.

For example, an ampersand shows as `&amp;` instead of `&` in the following question content preview:

![A question content preview with an HTML entity instead of an ampersand](https://meta.codidact.com/uploads/0007e02sury31hdl0587ssjbepxc)

The question linked above (about entities in titles) has an answer that suggests pasting in the character direct rather than using an HTML entity. This workaround works for uncommon characters not available from a particular regional keyboard, such as pasting in ℵ directly instead of typing `&aleph;` (the example given in that question). However, in the image above the ampersand was typed directly, and only converted into an HTML entity upon saving. This means the workaround cannot be used.

Is this enough reason to consider rendering HTML entities in question content previews (and possibly titles too)?

Alternatively, should this just be considered a more limited scope bug that only affects characters like ampersand that are automatically converted back to HTML entities preventing the workaround from working? Should a fix only consider such characters, like `&lt;` (<), `&gt;` (>), and `&amp;` (&)?