Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,8 @@
"docs",
"shared",
"tests"
]
],
"dependencies": {
"remark-breaks": "^4.0.0"
}
Copy link
Copy Markdown
Contributor

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

}
2 changes: 2 additions & 0 deletions packages/core/src/api/parsers/markdown/parseMarkdown.ts
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";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Honestly, would prefer not to introduce a whole package just for this

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.

would like to have tests added that prove it does not break existing behavior

Will add it soon 🙂
Thanks for the review 😊 !!!

import remarkRehype, {
defaultHandlers as remarkRehypeDefaultHandlers,
} from "remark-rehype";
Expand Down Expand Up @@ -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),
Expand Down
37 changes: 29 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.