Closed shaunanoordin closed 1 year ago
Was this closed by #3678? Entities still raise a 'document is not defined' error, but it doesn't crash the page any more.
I say let's close this issue for now, as the important thing is that the pages aren't crashing. 👌
(Context for anyone who didn't read #3678: instead of crashing the page, HTML entities in Markdown now render as <p>document is not defined</p>
on the page, and only if you have JS disabled.)
The only ways I can think of that the new "document is not defined" error could remotely be a problem are if (1) people notice "document is not defined" as the project's preview in their, erm, Google search results? (super unlikely, since our meta-description tags & etc now render fine)) or (2) we have a new logging system that automatically picks up the flood of console.errors in the dev log.
@shaunanoordin People will see 'document is not defined' when the page loads in their browser. https://www.zooniverse.org/projects/mariaedgeworthletters/maria-edgeworth-letters/about/team
https://user-images.githubusercontent.com/59547/191921740-f59175d5-62a0-4367-b07d-ed27d26d2838.mov
Uncategorised Bug?
Package:
app-project
, possibly others Affects: ⚠️ anything that uses Markdown, e.g. Project About Team page, About Project, Announcements banner, etcThe problem: if a Markdown component tries to render an escaped HTML entity such as
&
(ampersand), it crashes the whole page.&
and;
&
and&
render as&
on the webpage correctly.&
on the other hand will crash.&
in Markdown to begin with.document is not defined
. Rest of the page is blank.Dev Notes
Some notes from our investigation:
Scenario 1: literal symbols in the Markdown text
Play "Dungeons & Dragons" ©, it's > Cthulhu ♥
<
character in our Project Builder causes some things to go bonkers. Typing<
will transform it into<
and convert all>
into>
,&
into&
. Copy-pasting, especially when creating a HTML tag, causes even more WTF-ery. This is a separate project builder discussion.Scenario 2: proper HTML entities
Play "Dungeons & Dragons" ©, it's > Cthulhu ♥
Scenario 3?: sorta-proper HTML entities
Play "Dungeons & Dragons" ©, it's > Cthulhu &hearts
♥
, which is just rendered as literally&hearts
& " © >
are all legit, so certain HTML entities apparently don't need the;
. I learn something new every day.So anyway, it looks like HTML entities only crash our page if they're bracketed by both
&
and;
, but ALL HTML entities can crash us (not just the&
)Status
Unknown priority.EDIT: possibly solved by #3678