Desktop: Fixes #8530: Rich text editor: Use fewer
s in markdown while still preserving initial paragraph indentation
#8529
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.
Summary
This partially reverts a change made in #8468. This should fix #8530.
Before #8468,
turndown
replaced HTML nonbreaking spaces with their corresponding unicode characters. After,turndown
replaced nonbreaking spaces with the HTML escape
.While this fixes an issue where leading spaces would disappear from paragraph blocks when switching notes, it makes markdown much more difficult to read. For example,
instead of
(some of the above spaces are nonbreaking).
This pull request mostly reverts this change by only replacing the first nonbreaking space with an HTML escape sequence:
When rendered, this preserves the leading indentation while minimizing HTML-escaped
s.(A leading HTML-escaped
seems to be necessary to preserve indentation).Testing
This pull request does have an automated test. However, it can be tested manually. To do so,
this is a test
).In step 3, the markdown should only have a single
— the leading space. In step 4, the paragraph should still have leading spaces.