Communities

(DEV) Codidact Meta
(DEV) Codidact Meta
(DEV) Writing
(DEV) Writing
Proposals
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

Comments on Alt text containing double quotes

Parent

Alt text containing double quotes

+0
−0

An image with alt text text with "quote" inside:

![text with "quote" inside](https://a.dev.codidact.org/assets/logo.png)

text with "quote" inside

An image with alt text unmatched " inside:

![unmatched " inside](https://a.dev.codidact.org/assets/logo.png)

unmatched " inside

The same images with broken links to show the alt text

An image with alt text text with "quote" inside:

![text with "quote" inside](https://a.dev.codidact.org/assets/logo.pngx)

text with "quote" inside

An image with alt text unmatched " inside:

![unmatched " inside](https://a.dev.codidact.org/assets/logo.pngx)

unmatched " inside

History

2 comment threads

A new thread following the successful followownposts migration (2 comments)
This new thread should ping User C. (3 comments)
Post
+0
−0

It turns out the alt text is enclosed in single quotes if the alt text contains double quotes. What happens if the alt text contains both single and double quotes?

![both ' and " inside](https://a.dev.codidact.org/assets/logo.png)

both ' and " inside

The same image with a broken link to show the alt text

![both ' and " inside](https://a.dev.codidact.org/assets/logo.pngx)

both ' and " inside

How this still works

When the alt text contains both single and double quotes, double quotes are used to contain the alt text, and the contained double quote is represented as &quot;, which the browser renders as " as required:

<img alt="both ' and &quot; inside" src="https://a.dev.codidact.org/assets/logo.png">
History

2 comment threads

A new answer thread following the successful followownposts migration (2 comments)
This new thread should not ping User C (and should ping trichoplax as the author). (3 comments)
This new thread should not ping User C (and should ping trichoplax as the author).
Monica‭ wrote 9 days ago

This new thread should not ping User C (and should ping trichoplax as the author).

Monica‭ wrote 9 days ago

Did not ping User C (correct).

Trich O'Plax‭ wrote 7 days ago

Reply in a thread trichoplax is not following.