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

Turndown: Fixes #5025: Convert inline katex html to its equivalent inline katex markdown #5052

Merged
merged 2 commits into from
Jun 8, 2021

Conversation

Subhra264
Copy link
Contributor

Fixes: #5025

Currently, the turndown adds '\n\n' around the content of joplin-source element assuming it as a block element( even if the joplin-editable node is a span element). As a result, the inline katex expression inside joplin-editable span element, gets converted to Md, but on a new line even though it is an inline expression.

This PR first checks if the joplin-editable element is an inline element, and then surrounds the content with relevant character.

Tests :

katex_test

\sqrt{3x}
$$</pre>
</div>

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't use these tests anymore, they are from the original source code that we've forked, so please remove these changes and move anything relevant to html_to_md directory

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohh ok, I will do that

@Subhra264
Copy link
Contributor Author

Moved the tests from index.html to app-cli/tests/html_to_md folder

@laurent22
Copy link
Owner

Looks good now, thanks for the fix @Subhra264!

@laurent22 laurent22 merged commit ce02a30 into laurent22:dev Jun 8, 2021
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.

Katex gets broken when edit in wysiwyg mode
2 participants