-
-
Notifications
You must be signed in to change notification settings - Fork 725
fix: Plain text paste does not preserve line breaks #2702
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -85,5 +85,8 @@ | |
| "docs", | ||
| "shared", | ||
| "tests" | ||
| ] | ||
| ], | ||
| "dependencies": { | ||
| "remark-breaks": "^4.0.0" | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| import { Schema } from "prosemirror-model"; | ||
| import remarkGfm from "remark-gfm"; | ||
| import remarkParse from "remark-parse"; | ||
| import remarkBreaks from "remark-breaks"; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Honestly, would prefer not to introduce a whole package just for this. And would like to have tests added that prove it does not break existing behavior
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
For this operation adding a package is worth, Because doing it from scratch without the help of package might break some edge cases which may introduce unusual behaviour.
Will add it soon 🙂 |
||
| import remarkRehype, { | ||
| defaultHandlers as remarkRehypeDefaultHandlers, | ||
| } from "remark-rehype"; | ||
|
|
@@ -80,6 +81,7 @@ export function markdownToHTML(markdown: string): string { | |
| const htmlString = unified() | ||
| .use(remarkParse) | ||
| .use(remarkGfm) | ||
| .use(remarkBreaks) | ||
| .use(remarkRehype, { | ||
| handlers: { | ||
| ...(remarkRehypeDefaultHandlers as any), | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is installed to the wrong package.json, it should be installed to the one in packages/core/package.json, this is a monorepo