Fix missing reply text when message body is parsed as HTML in linkedom (SSR)
#666
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix missing reply text when message body is parsed as HTML in
linkedom(SSR).linkedomis being used https://github.com/matrix-org/matrix-public-archive to server-side render (SSR) Hydrogen (hydrogen-view-sdk)DOMParserto get a matching result in the browser andlinkedom.Currently
parseHTMLis only used for HTML content bodies in events. Events with replies have content bodies that look like<mx-reply>Hello</mx-reply> What's upso they're parsed as HTML to strip out the<mx-reply>part.Dev notes
Before:
After (consistent matching output):
Why does
linkedombehavior differ from real browsers?linkedomgoal is to be close to the current DOM standard, but not too close. Focused on the streamlined cases for server-side rendering (SSR).Here is some context around getting
DOMParserto interpret things better. The conclusion was to only support the explicit standard cases with a<html><body></body></html>specified instead of adding the magic HTML document creation and massaging that the browser does.Part of #653 to support server-side rendering Hydrogen for the
matrix-public-archiveproject.