You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.
The function to add line breaks is deprecated and fell out of use at the point of doing #472, so the Dom shouldn't contain these nodes. However, the LineBreak node is still being used to represent line breaks in the Dom immediately after parsing, before being post-processed into paragraphs.
This is a bit problematic because although we can expect that the Dom should no longer contain LineBreaks, there is a lot of existing code that expects that it might which is effectively dead code and a maintenance burden.
Possible solutions
Remove the LineBreak node and parse directly to Container. It will be the most effort but, after this PR, we have compatible tests to make this easier. There is also the question of whether this would put too much logic in the HTML parser.
Keep the LineBreak node but refactor it to something like Placeholder(LineBreak), adding an invariant assertion that it should not exist in the Dom. We could remove any logic that handles this node type and replace it with an unreachable! error.
The text was updated successfully, but these errors were encountered:
Problem
Raised in #834 (comment)
The function to add line breaks is deprecated and fell out of use at the point of doing #472, so the Dom shouldn't contain these nodes. However, the LineBreak node is still being used to represent line breaks in the Dom immediately after parsing, before being post-processed into paragraphs.
This is a bit problematic because although we can expect that the Dom should no longer contain LineBreaks, there is a lot of existing code that expects that it might which is effectively dead code and a maintenance burden.
Possible solutions
directly to Container. It will be the most effort but, after this PR, we have compatible tests to make this easier. There is also the question of whether this would put too much logic in the HTML parser.
The text was updated successfully, but these errors were encountered: