Line break not working in comment #199

Closed
opened 2026-02-04 17:48:51 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @rlgo on GitHub (Jun 4, 2022).

Write two line comment but still display as one line after save.
Screenshot from 2022-06-04 08-10-20
Screenshot from 2022-06-04 08-17-31

But if add an empty line in between, it works
Screenshot from 2022-06-04 08-21-32
Screenshot from 2022-06-04 08-20-12

Originally created by @rlgo on GitHub (Jun 4, 2022). Write two line comment but still display as one line after save. ![Screenshot from 2022-06-04 08-10-20](https://user-images.githubusercontent.com/32289083/171968584-285d8936-6a9f-4762-8ae6-b4c7afe492f6.png) ![Screenshot from 2022-06-04 08-17-31](https://user-images.githubusercontent.com/32289083/171968871-422e4924-21a7-41d1-9475-94ed39d5587e.png) But if add an empty line in between, it works ![Screenshot from 2022-06-04 08-21-32](https://user-images.githubusercontent.com/32289083/171969008-167e0418-6323-4397-9b70-692f0638876f.png) ![Screenshot from 2022-06-04 08-20-12](https://user-images.githubusercontent.com/32289083/171968959-b1abff2b-208c-4bba-8d55-f6a3dfbca710.png)
Author
Owner

@ejo090 commented on GitHub (Jun 4, 2022):

Since Planka uses Markdown for the description and comment fields of cards, it is possible to break lines according to Markdown notation.

Planka uses remarkjs/react-markdown as a renderer and remarkjs/remark-gfm as a plugin.

The specification is available at GitHub Flavored Markdown Spec.

The line breaks are also described in the GFM Spec mentioned above.
(e.g. 6.12 Hard line breaks, 6.13 Soft line breaks )

If a blank line is inserted between comment1 and comment2, it looks like a line break because the paragraph changes.
(Figure omitted.)(e.g. 4.8 Paragraphs)

  • Hard Line Break(with two spaces = <br> equivalent)
    01
    02

  • Hard Line Break(with \ = <br> equivalent )
    03
    04

  • Soft Line Break(Line breaks only in the editor = replaced by space)
    05
    06

The problem is that the GFM Spec differs from the behavior on github.com that we are using.
On our github.com, line breaks in the editor are interpreted as "hard line breaks".

It may be a good idea to add remarkjs/remark-breaks to handle this.

@ejo090 commented on GitHub (Jun 4, 2022): Since Planka uses Markdown for the description and comment fields of cards, it is possible to break lines according to Markdown notation. Planka uses [remarkjs/react-markdown](https://github.com/remarkjs/react-markdown) as a renderer and [remarkjs/remark-gfm](https://github.com/remarkjs/remark-gfm) as a plugin. The specification is available at [GitHub Flavored Markdown Spec](https://github.github.com/gfm/). The line breaks are also described in the GFM Spec mentioned above. (e.g. [6.12 Hard line breaks](https://github.github.com/gfm/#hard-line-breaks), [6.13 Soft line breaks](https://github.github.com/gfm/#soft-line-breaks) ) If a blank line is inserted between comment1 and comment2, it looks like a line break because the paragraph changes. (Figure omitted.)(e.g. [4.8 Paragraphs](https://github.github.com/gfm/#paragraphs)) - Hard Line Break(with two spaces = `<br>` equivalent) ![01](https://user-images.githubusercontent.com/3481374/171988255-55e4e1aa-e818-4879-b76a-e92cdb445685.png) ![02](https://user-images.githubusercontent.com/3481374/171988259-4c782d19-8053-4e1f-baa4-42604dc3d06f.png) - Hard Line Break(with `\` = `<br>` equivalent ) ![03](https://user-images.githubusercontent.com/3481374/171988359-3f1c3a49-fc74-46cc-9dbe-9dd5df778945.png) ![04](https://user-images.githubusercontent.com/3481374/171988377-5a6750be-6f7f-4f24-a679-2e9c72decb8b.png) - Soft Line Break(Line breaks only in the editor = replaced by space) ![05](https://user-images.githubusercontent.com/3481374/171988434-748f0974-db01-445a-b81c-d7c449985281.png) ![06](https://user-images.githubusercontent.com/3481374/171988437-047407e4-6212-402b-9024-d9f0e3eda07c.png) The problem is that the GFM Spec differs from the behavior on github.com that we are using. On our github.com, line breaks in the editor are interpreted as "hard line breaks". It may be a good idea to add [remarkjs/remark-breaks](https://github.com/remarkjs/remark-breaks) to handle this.
Author
Owner

@ejo090 commented on GitHub (Jun 4, 2022):

I applied remarkjs/remark-breaks, which probably fulfills what @rlgo wants.

01
02

(I forgot to mention that the language setting is Japanese. Sorry.)
("コメントを追加" means "Add comment")

@ejo090 commented on GitHub (Jun 4, 2022): I applied [remarkjs/remark-breaks](https://github.com/remarkjs/remark-breaks), which probably fulfills what @rlgo wants. ![01](https://user-images.githubusercontent.com/3481374/171992147-583d8065-951b-464f-9b01-5c1cde94d529.png) ![02](https://user-images.githubusercontent.com/3481374/171992157-337d436c-005f-4ab0-a916-fed14aedb3c1.png) (I forgot to mention that the language setting is Japanese. Sorry.) ("コメントを追加" means "Add comment")
Author
Owner

@nickbe commented on GitHub (Jun 5, 2022):

Thanks for the effort to explain all this. In fact I didn't realize the line break problem myself so far simply because I don't use comments as extensively as other users.

Please feel free to make a pull request on this.
@meltyshev Using a more convienent way for the line breaks is a very good idea.

@nickbe commented on GitHub (Jun 5, 2022): Thanks for the effort to explain all this. In fact I didn't realize the line break problem myself so far simply because I don't use comments as extensively as other users. Please feel free to make a pull request on this. @meltyshev Using a more convienent way for the line breaks is a very good idea.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/planka#199