Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Adjust math delimiter to fix markdown import/export compatibility issue #6727

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dreamerblue
Copy link

@dreamerblue dreamerblue commented Mar 27, 2024

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:

## Inline

Here is inline $x=y$

## Block

$$
y=x
$$

Excepted result in Outline editor:

image

All general LaTeX texts should be converted to Outline math_inline or math_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 in state, only the generated text 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):

image

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.

@auto-assign auto-assign bot requested a review from tommoor March 27, 2024 09:32
@CLAassistant
Copy link

CLAassistant commented Mar 27, 2024

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants