HTML in Comments field no longer renders #3322

Closed
opened 2025-12-29 18:27:41 +01:00 by adam · 6 comments
Owner

Originally created by @JNR8 on GitHub (Feb 13, 2020).

Environment

Python version: 3.5.2
NetBox version: 2.7.4

HTML in the Comment box of a Rack, device, or any other item with this field, does not render.

Steps to Reproduce

  1. Edit a device (a Rack for Example)
  2. add an iFrame, or Img tag. (e.g. <img src="https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png" alt="Internal" width="800"/>)
  3. Save changes
  4. View Comments of device.

I expected to see the HTML code render, as it did in pervious versions.

Nothing. Nothing shows in the Comments box. MarkDown still shows, but HTML does not.

I am not sure in which version this issue stared. I updated to 2.7.4 today after not using netBxo for a few weeks, and just noticed the issue.

Originally created by @JNR8 on GitHub (Feb 13, 2020). ### Environment Python version: 3.5.2 NetBox version: 2.7.4 HTML in the Comment box of a Rack, device, or any other item with this field, does not render. ### Steps to Reproduce 1. Edit a device (a Rack for Example) 2. add an iFrame, or Img tag. (e.g. `<img src="https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png" alt="Internal" width="800"/>`) 3. Save changes 4. View Comments of device. <!-- What did you expect to happen? --> I expected to see the HTML code render, as it did in pervious versions. <!-- What happened instead? --> Nothing. Nothing shows in the Comments box. MarkDown still shows, but HTML does not. I am not sure in which version this issue stared. I updated to 2.7.4 today after not using netBxo for a few weeks, and just noticed the issue.
adam closed this issue 2025-12-29 18:27:42 +01:00
Author
Owner

@phurrelmann commented on GitHub (Feb 13, 2020):

This was intentionally disabled in 2.6.6 (#3471 Disallow raw HTML in Markdown-rendered fields)

@phurrelmann commented on GitHub (Feb 13, 2020): This was intentionally disabled in 2.6.6 (#3471 Disallow raw HTML in Markdown-rendered fields)
Author
Owner

@JNR8 commented on GitHub (Feb 13, 2020):

Not sure whats happening with the above text. Each time I edit the post it only show a portion of it.

I have posted it again below, hopefully this will not break as above has.

Steps to Reproduce

  1. Edit a device (a Rack for Example)
  2. add an iFrame, or Img tag. (e.g. <img src="https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png" alt="Internal" width="800"/>)
  3. Save changes
  4. View Comments of device.

I expected to see the HTML code render, as it did in pervious versions.

Nothing. Nothing shows in the Comments box. MarkDown still shows, but HTML does not.

I am not sure in which version this issue stared. I updated to 2.7.4 today after not using netBxo for a few weeks, and just noticed the issue.

@JNR8 commented on GitHub (Feb 13, 2020): Not sure whats happening with the above text. Each time I edit the post it only show a portion of it. I have posted it again below, hopefully this will not break as above has. <!-- ### Environment * Python version: 3.5.2 * NetBox version: 2.7.4 <!-- HTML in the Comment box of a Rack, device, or any other item with this field, does not render. --> ### Steps to Reproduce 1. Edit a device (a Rack for Example) 2. add an iFrame, or Img tag. (e.g. `<img src="https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png" alt="Internal" width="800"/>`) 3. Save changes 4. View Comments of device. <!-- What did you expect to happen? --> I expected to see the HTML code render, as it did in pervious versions. <!-- What happened instead? --> Nothing. Nothing shows in the Comments box. MarkDown still shows, but HTML does not. I am not sure in which version this issue stared. I updated to 2.7.4 today after not using netBxo for a few weeks, and just noticed the issue.
Author
Owner

@JNR8 commented on GitHub (Feb 13, 2020):

@phurrelmann Well thats annoying. As NetBox does not render the images you can upload I was using this field to link to the uploaded images for images of locations, racks, wiring diagrams, and map locations.

This has really ruined the way I document a lot of things in Netbox. I understand that it was not intended to be used in this way, but this feature was really useful as I could present a lot of information on one screen to someone who needed it. Especially in environments where wiring diagrams between SAN shelves could be visualised to the viewer.

Can this be turned back on as an option in furture updates?

@JNR8 commented on GitHub (Feb 13, 2020): @phurrelmann Well thats annoying. As NetBox does not render the images you can upload I was using this field to link to the uploaded images for images of locations, racks, wiring diagrams, and map locations. This has really ruined the way I document a lot of things in Netbox. I understand that it was not intended to be used in this way, but this feature was really useful as I could present a lot of information on one screen to someone who needed it. Especially in environments where wiring diagrams between SAN shelves could be visualised to the viewer. Can this be turned back on as an option in furture updates?
Author
Owner

@jeremystretch commented on GitHub (Feb 13, 2020):

Not sure whats happening with the above text.

You had an errant <!-- at the top, which was commenting out the text following it until the next -->.

As NetBox does not render the images you can upload I was using this field to link to the uploaded images for images of locations, racks, wiring diagrams, and map locations.

You can use Markdown to embed images.

Can this be turned back on as an option in furture updates?

I think given the intended use of the comments fields it makes sense not to support raw HTML. It really shouldn't be needed, and there's no reasonable way to do it safely.

I'm going to close out this issue as I believe the above solution addresses your use case, but please feel free to post to the discussion list if you want any help with Markdown.

@jeremystretch commented on GitHub (Feb 13, 2020): > Not sure whats happening with the above text. You had an errant `<!--` at the top, which was commenting out the text following it until the next `-->`. > As NetBox does not render the images you can upload I was using this field to link to the uploaded images for images of locations, racks, wiring diagrams, and map locations. You can use Markdown to [embed images](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#images). > Can this be turned back on as an option in furture updates? I think given the intended use of the comments fields it makes sense not to support raw HTML. It really shouldn't be needed, and there's no reasonable way to do it safely. I'm going to close out this issue as I believe the above solution addresses your use case, but please feel free to post to the [discussion list](https://groups.google.com/forum/#!forum/netbox-discuss) if you want any help with Markdown.
Author
Owner

@JNR8 commented on GitHub (Feb 13, 2020):

Great. Thats should fix my issues. Thank you.

@JNR8 commented on GitHub (Feb 13, 2020): Great. Thats should fix my issues. Thank you.
Author
Owner

@JNR8 commented on GitHub (Feb 14, 2020):

unfortunately this does not fix my issue. I need to resize the image to fit the size of the comment field as all the images I have larger than the comment box width.

From what I have searched so far MarkDown does not seem to allow for image resizing as it renders. Thus making the larger images spread across the page, underneath existing eelements on that page resulting in not being able to see parts of the image and creating a mess.

@JNR8 commented on GitHub (Feb 14, 2020): unfortunately this does not fix my issue. I need to resize the image to fit the size of the comment field as all the images I have larger than the comment box width. From what I have searched so far MarkDown does not seem to allow for image resizing as it renders. Thus making the larger images spread across the page, underneath existing eelements on that page resulting in not being able to see parts of the image and creating a mess.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3322