فهرست منبع

Fixes #4343: Fix Markdown support for tables

Jeremy Stretch 6 سال پیش
والد
کامیت
79aba5edf2
2فایلهای تغییر یافته به همراه3 افزوده شده و 2 حذف شده
  1. 1 0
      docs/release-notes/version-2.7.md
  2. 2 2
      netbox/utilities/templatetags/helpers.py

+ 1 - 0
docs/release-notes/version-2.7.md

@@ -5,6 +5,7 @@
 ### Bug Fixes
 ### Bug Fixes
 
 
 * [#4340](https://github.com/netbox-community/netbox/issues/4340) - Enforce unique constraints for device and virtual machine names in the API
 * [#4340](https://github.com/netbox-community/netbox/issues/4340) - Enforce unique constraints for device and virtual machine names in the API
+* [#4343](https://github.com/netbox-community/netbox/issues/4343) - Fix Markdown support for tables
 
 
 ## v2.7.10 (2020-03-10)
 ## v2.7.10 (2020-03-10)
 
 

+ 2 - 2
netbox/utilities/templatetags/helpers.py

@@ -40,7 +40,7 @@ def render_markdown(value):
     value = strip_tags(value)
     value = strip_tags(value)
 
 
     # Render Markdown
     # Render Markdown
-    html = markdown(value, extensions=['fenced_code'])
+    html = markdown(value, extensions=['fenced_code', 'tables'])
 
 
     return mark_safe(html)
     return mark_safe(html)
 
 
@@ -196,7 +196,7 @@ def get_docs(model):
         return "Unable to load documentation, error reading file: {}".format(path)
         return "Unable to load documentation, error reading file: {}".format(path)
 
 
     # Render Markdown with the admonition extension
     # Render Markdown with the admonition extension
-    content = markdown(content, extensions=['admonition', 'fenced_code'])
+    content = markdown(content, extensions=['admonition', 'fenced_code', 'tables'])
 
 
     return mark_safe(content)
     return mark_safe(content)