This repository has been archived by the owner on Sep 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Replace paragraphs with line breaks in message output #834
Merged
Merged
Changes from 27 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
96a182d
Replace paragraphs with line breaks in message output
jonnyandrew 1562880
Parse line breaks to paragraphs
jonnyandrew 07aa46a
Update rendering tests
jonnyandrew d7964e5
Fix deletion tests
jonnyandrew 536a4b4
Update find range tests
jonnyandrew 15f4166
Update inline code tests
jonnyandrew 983a436
Update example format tests
jonnyandrew 0268f47
Update paragraphs tests
jonnyandrew e6537e3
Update mentions tests
jonnyandrew efd2aed
Update quotes tests
jonnyandrew b5310c1
Update wrap in block tests
jonnyandrew a0bd138
Update wrap in list tests
jonnyandrew 519bac4
Update dom iterator tests
jonnyandrew ef5faa0
Update characters test
jonnyandrew ac09d04
Update formatting tests
jonnyandrew da49ec5
Update link tests
jonnyandrew 519ff31
Refactor
jonnyandrew 74337c9
Update web test
jonnyandrew 9539239
Handle paragraphs mixed with inline content
jonnyandrew a40c98a
Fix repeated post-processing by web parser
jonnyandrew e6370a3
Don't add line breaks where it is implicit
jonnyandrew a642b37
Fix clippy issue
jonnyandrew 482862b
Add documentation to explain paragaph grouping logic
jonnyandrew 76fa0b7
Merge branch 'main' of github.com:matrix-org/matrix-rich-text-editor …
jonnyandrew 9ed1a4f
update snapshot on ios
langleyd e3ed1f6
Revert "update snapshot on ios"
langleyd ba2e8c9
Update SnapshotTests+Blocks.swift
langleyd 88e69e5
Fix testMultipleBlocksContent according to new format.
langleyd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we convert paragraphs to line breaks do we still need
LineBreak
type internally in the Dom?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function to add line breaks is deprecated and fell out of use at the point of doing #472 I believe, 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
LineBreak
s, there is a lot of existing code that expects that it might which is effectively dead code and a maintenance burden.Perhaps we can either
LineBreak
node and parse<br>
directly toContainer
. 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.LineBreak
node but refactor it to something likePlaceholder(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 anunreachable!
error.What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for that. I'm ok with either option, was more trying to understand it's current use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.