Single Linebreak in Markdown should lead to Linebreak in Output #9337

Closed
opened 2025-12-29 20:48:42 +01:00 by adam · 3 comments
Owner

Originally created by @xeiss on GitHub (Mar 8, 2024).

Deployment Type

Self-hosted

NetBox Version

v3.7.3

Python Version

3.9

Steps to Reproduce

  1. Create any object with a Markdown field, for example an device with Comments field.
  2. Write Text with one line break into it, for example: "Text 1(ENTER)Text 2", that it looks like:
    Text 1
    Text 2
  3. Click on Preview (or save and look at the object)

Expected Behavior

One line break should lead to an
in html and so it should in preview look like:
Text 1
Text 2

HTML:

<div class="rendered-markdown"><p>Text 1
<br>
Text 2</p></div>

I should behavior like it is documented in https://docs.netbox.dev/en/stable/reference/markdown/ - at the bottom you find "Line Breaks" example, you can see a line break after "but..." and so also in the output text.

Observed Behavior

In preview the example text look like:
Text 1 Text 2

HTML:

<div class="rendered-markdown"><p>Text 1 
Text 2</p></div>
Originally created by @xeiss on GitHub (Mar 8, 2024). ### Deployment Type Self-hosted ### NetBox Version v3.7.3 ### Python Version 3.9 ### Steps to Reproduce 1. Create any object with a Markdown field, for example an device with Comments field. 2. Write Text with one line break into it, for example: "Text 1(ENTER)Text 2", that it looks like: Text 1 Text 2 3. Click on Preview (or save and look at the object) ### Expected Behavior One line break should lead to an <br> in html and so it should in preview look like: Text 1 Text 2 HTML: ``` <div class="rendered-markdown"><p>Text 1 <br> Text 2</p></div> ``` I should behavior like it is documented in https://docs.netbox.dev/en/stable/reference/markdown/ - at the bottom you find "Line Breaks" example, you can see a line break after "but..." and so also in the output text. ### Observed Behavior In preview the example text look like: Text 1 Text 2 HTML: ``` <div class="rendered-markdown"><p>Text 1 Text 2</p></div> ```
adam closed this issue 2025-12-29 20:48:42 +01:00
Author
Owner

@jeremystretch commented on GitHub (Mar 8, 2024):

NetBox renders Markdown in conformance with its specification, which asserts:

When you do want to insert a <br /> break tag using Markdown, you end a line with two or more spaces, then type return.

This is how the documentation example you reference is written.

@jeremystretch commented on GitHub (Mar 8, 2024): NetBox renders Markdown in conformance with its [specification](https://daringfireball.net/projects/markdown/syntax#p), which asserts: > When you _do_ want to insert a `<br />` break tag using Markdown, you end a line with two or more spaces, then type return. This is how the documentation example you reference is written.
Author
Owner

@xeiss commented on GitHub (Mar 9, 2024):

Okay, I don’t know about this official specs because every Markdown I know ignores this and accept line breaks without double spaces. Also, Github itself seems to ignore this, because it is more natural, I think.

But in this case the documentation is wrong. https://docs.netbox.dev/en/stable/reference/markdown/
When there would be double spaces after "but ..." in the bottom example code. I would copy that and find out, that I need double spaces by my own. But also, this example doesn't work that is why I thought it is a bug and raised this issue.

@xeiss commented on GitHub (Mar 9, 2024): Okay, I don’t know about this official specs because every Markdown I know ignores this and accept line breaks without double spaces. Also, Github itself seems to ignore this, because it is more natural, I think. But in this case the documentation is wrong. https://docs.netbox.dev/en/stable/reference/markdown/ When there would be double spaces after "but ..." in the bottom example code. I would copy that and find out, that I need double spaces by my own. But also, this example doesn't work that is why I thought it is a bug and raised this issue.
Author
Owner

@jeffgdotorg commented on GitHub (Mar 10, 2024):

But in this case the documentation is wrong.

Please open a new issue against the docs and we'll consider it separately. Thanks.

@jeffgdotorg commented on GitHub (Mar 10, 2024): > But in this case the documentation is wrong. Please open a new issue against the docs and we'll consider it separately. Thanks.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9337