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: don't render terminal linebreaks #1777

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 4 additions & 0 deletions packages/@atjson/renderer-commonmark/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,10 @@
return "";
}

if (context.parent == null && context.next == null) {
return "";
}

// MD code and html blocks cannot contain line breaks
// https://spec.commonmark.org/0.29/#example-637
if (context.parent?.type === "code" || context.parent?.type === "html") {
Expand Down Expand Up @@ -710,8 +714,8 @@
* Paragraphs are delimited by two or more newlines in markdown.
*/
*Paragraph(
_paragraph: Block<Paragraph>,

Check warning on line 717 in packages/@atjson/renderer-commonmark/src/index.ts

View workflow job for this annotation

GitHub Actions / build

'_paragraph' is defined but never used
_context: Context

Check warning on line 718 in packages/@atjson/renderer-commonmark/src/index.ts

View workflow job for this annotation

GitHub Actions / build

'_context' is defined but never used
): Generator<void, string, string[]> {
if (this.state.inlineOnly) {
return "";
Expand Down
Loading
Loading