Explorar el Código

Closes 10759: Enable markdown support for custom field descriptions (#12344)

* enable markdown in custom field descriptions

* Closes #10759: Enable markdown support for custom field descriptions

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
Austin de Coup-Crank hace 2 años
padre
commit
b14a514b47
Se han modificado 2 ficheros con 2 adiciones y 1 borrados
  1. 1 0
      netbox/extras/tables/tables.py
  2. 1 1
      netbox/templates/extras/customfield.html

+ 1 - 0
netbox/extras/tables/tables.py

@@ -29,6 +29,7 @@ class CustomFieldTable(NetBoxTable):
     content_types = columns.ContentTypesColumn()
     required = columns.BooleanColumn()
     ui_visibility = columns.ChoiceFieldColumn(verbose_name="UI visibility")
+    description = columns.MarkdownColumn()
     is_cloneable = columns.BooleanColumn()
 
     class Meta(NetBoxTable.Meta):

+ 1 - 1
netbox/templates/extras/customfield.html

@@ -32,7 +32,7 @@
           </tr>
           <tr>
             <th scope="row">Description</th>
-            <td>{{ object.description|placeholder }}</td>
+            <td>{{ object.description|markdown|placeholder }}</td>
           </tr>
           <tr>
             <th scope="row">Required</th>