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

Improve notebook markdown cell rendering #13577

Merged
merged 1 commit into from
Apr 9, 2024

Conversation

msujew
Copy link
Member

@msujew msujew commented Apr 9, 2024

What it does

Improves the markdown rendering logic of markdown cells by rendering the HTML element directly into the markdown cell without using innerHTML manipulation.

This allows to keep the mouse based events that the markdown renderer attaches to the HTML elements. Elements such as links are broken when attempting to use innerHTML manipulation.

How to test

  1. Create a new markdown cell and set the content:
## Heading 2

### Heading 3

This is a paragraph of text.

- Item 1
- Item 2
- Item 3

**Bold text**

*Italic text*

[Link to Google](https://www.google.com)
  1. Click on the link and ensure that it opens in a new browser tab.
  2. Create a new empty markdown cell and finish editing. Double clicking the cell should enter edit mode.

Review checklist

Reminder for reviewers

@msujew msujew added the notebook issues related to notebooks label Apr 9, 2024
@msujew msujew requested a review from jonah-iden April 9, 2024 00:16
Copy link
Contributor

@jonah-iden jonah-iden left a comment

Choose a reason for hiding this comment

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

nice solution. Works great! Also seems to be more performant according to some articles. Maybe we should do the same with the cell editor

@msujew msujew merged commit cadb020 into master Apr 9, 2024
14 checks passed
@msujew msujew deleted the msujew/notebook-markdown-render branch April 9, 2024 08:43
@github-actions github-actions bot added this to the 1.49.0 milestone Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notebook issues related to notebooks
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants