fix: Adjust math delimiter to fix markdown import/export compatibility issue #6727
+7
−7
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.
This PR is expected to fix the markdown import/export compatibility issue in #6650.
Test cases
Case 1: Import
Here is the test case, save as
.md
and use it to import document:Excepted result in Outline editor:
All general LaTeX texts should be converted to Outline
math_inline
ormath_block
.Case 2: Input and view in editor
This PR won't modify the input shortcut and trigger key. So the original trigger points (
$$
for inline,$$$ + Space
for block) are preserved. And all imported or manaually inputed math nodes is still correct instate
, only the generatedtext
is changed.Case 3: Export
Export an Outline document which contains math inline/block to markdown.
The result
.md
shoule be like (All formulas can be rendered correctly in any other editors):Other notes
I'm new to contributing to this project, and after reading some of the source code and trying to modify it, I verified these test cases above locally.
This modification does not automatically fix documents that already have custom text cached in the Outline database (e.g.
$$$
), it only works for new incremental documents. Perhaps the core maintainer could help add a batch function for auto-fixing. The old text cache may only be affected if the export function is used. Viewing and editing in Outline still works fine for older documents.