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 markdown plugin for copy/paste code #1326

Merged
merged 8 commits into from
Oct 19, 2022

Conversation

juliaroldi
Copy link
Contributor

@juliaroldi juliaroldi commented Oct 10, 2022

When a text is pasted, it might create new inlineElement inside the current element, then to ensure the text must be converted or not, check text of the parentBlock.

markDownFeat

@@ -54,8 +54,11 @@ function cacheGetRangeForMarkdownOperation(
return false;
}

const parentBlockText = textInlineElement.getParentBlock().getTextContent();
Copy link
Collaborator

Choose a reason for hiding this comment

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

need to add comment to explain why we do this, better with some example

@@ -54,6 +54,8 @@ function cacheGetRangeForMarkdownOperation(
return false;
}

//if the text is pasted, it might create a inner element inside the text element,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it possible to have two or more layers of DIV?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if we have to or more layers, the markdown plugin will not work. It only work for inline elements.

@juliaroldi juliaroldi merged commit 91b3c38 into master Oct 19, 2022
@juliaroldi juliaroldi deleted the u/juliaroldi/markdown-plugin branch October 19, 2022 21:44
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