zooniverse / Panoptes-Front-End

Front end for zooniverse/Panoptes
https://www.zooniverse.org
Apache License 2.0
64 stars 75 forks source link

Talk: search silently errors with 'string contains an invalid character' #7067

Closed eatyourgreens closed 3 months ago

eatyourgreens commented 3 months ago

Expected behavior

Talk should try to display comments, even with invalid characters?

Current behavior

A blank white page, with the error thrown in the dev console.

Steps to replicate

https://www.zooniverse.org/talk/search?page=11&query=add

Additional context

There's some text in a comment which Markdown is attempting to parse as a React component.

The above error occurred in the <perv<|goto|> component:

perv<|goto|
div
Markdown@https://localhost:3735/main.js:222135:7
div
TalkSearchResult@https://localhost:3735/main.js:125106:20
section
div
div
div
TalkSearch
div
Talk
eatyourgreens commented 3 months ago

Turns out this is a side effect of a bigger bug, which is that Talk search results are being displayed as raw markdown strings. The HTML parser in the Markdown component errors if it's passed a string that can't be parsed as HTML.