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

Added conversion support for markdown equations. #247

Merged
merged 1 commit into from
Jan 24, 2021

Conversation

egordm
Copy link
Contributor

@egordm egordm commented Dec 30, 2020

I have noticed when you load a block which contains inline equations, for example ($$A \leftarrow B$$), then it is rendered as a single character (⁍ / \u204d). This is mostly because the inline equation blocks are formatted the following way ["⁍", [["e","A \leftarrow B"]]] which is currently not interpreted correctly.

This PR adds correct conversion from and to markdown for inline equations. While markdown does not natively support inline equations, I decided to use the same block enclosing notion uses ($$).

Thanks in advance.

Example usage:

from notion.block import BulletedListBlock

newchild = page.children.add_new(BulletedListBlock, title="Some fancy equation: $$y = ax + b$$...")

@egordm egordm changed the title Added conversion support for markdown equations. Both to and from the… Added conversion support for markdown equations. Dec 30, 2020
@jamalex
Copy link
Owner

jamalex commented Jan 24, 2021

Thanks for the contribution! If you want to help prevent this from breaking down the road, you might also consider adding some pieces to the smoke_test.py scenarios (and perhaps your short example to the README).

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.

2 participants