netbox icon indicating copy to clipboard operation
netbox copied to clipboard

Markdown doesn't render in custom fields in table view

Open chcon opened this issue 3 years ago • 4 comments

NetBox version

v3.2.8

Python version

3.8

Steps to Reproduce

  1. Create a custom field of type Text(long) for any content type, e.g. IPAM->IP addresses
  2. Add some Markdown or raw HTML to the custom column for an IP address object in the IPAM
  3. See that the Markdown/raw HTML is not rendering in the IPAM->IP addresses table view

This was working in v3.2.7, so this is probably due to this merge request: https://github.com/netbox-community/netbox/commit/38350a102320ea4b1f6bdb81b454c452f9779d2b

Expected Behavior

Markdown should render in custom columns in the table view for any content type if field type Text(long) was chosen for the custom column.

Observed Behavior

Markdown/raw HTML is not rendering for Text(long) custom columns in the table view of any content type like IPAM->IP addresses.

chcon avatar Aug 11 '22 10:08 chcon

Just fixed it in my local environment. If you want to assign me to this one I will create a pull request.

chcon avatar Aug 11 '22 12:08 chcon

Thanks @chcon!

jeremystretch avatar Aug 11 '22 12:08 jeremystretch

This was working in v3.2.7

Was it? I tried using v3.2.7 and it doesn't render markdown in table columns. There's no logic in CustomFieldColumn to render Markdown, so I doubt this has ever worked.

jeremystretch avatar Aug 15 '22 13:08 jeremystretch

No, you are right. Just checked, I am using plain HTML in some custom columns, and not markdown. But plain HTML definitely worked before 3.2.8 (which ultimately led to the XSS flaw).

chcon avatar Aug 15 '22 13:08 chcon