diff --git a/netbox/project-static/dist/netbox-dark.css b/netbox/project-static/dist/netbox-dark.css index 25017505e..e711685bf 100644 Binary files a/netbox/project-static/dist/netbox-dark.css and b/netbox/project-static/dist/netbox-dark.css differ diff --git a/netbox/project-static/dist/netbox-light.css b/netbox/project-static/dist/netbox-light.css index 07ad0dba2..10c15397d 100644 Binary files a/netbox/project-static/dist/netbox-light.css and b/netbox/project-static/dist/netbox-light.css differ diff --git a/netbox/project-static/dist/netbox-print.css b/netbox/project-static/dist/netbox-print.css index a09f49222..4562597d8 100644 Binary files a/netbox/project-static/dist/netbox-print.css and b/netbox/project-static/dist/netbox-print.css differ diff --git a/netbox/project-static/styles/netbox.scss b/netbox/project-static/styles/netbox.scss index acbfa0646..d78429bf9 100644 --- a/netbox/project-static/styles/netbox.scss +++ b/netbox/project-static/styles/netbox.scss @@ -965,6 +965,19 @@ div.card-overlay { max-width: unset; } +/* Rendered Markdown */ +.rendered-markdown table { + width: 100%; +} +.rendered-markdown th { + border-bottom: 2px solid #dddddd; + padding: 8px; +} +.rendered-markdown td { + border-top: 1px solid #dddddd; + padding: 8px; +} + // Preformatted text blocks td pre { margin-bottom: 0 diff --git a/netbox/templates/circuits/provider.html b/netbox/templates/circuits/provider.html index b04e7be7a..14fd00863 100644 --- a/netbox/templates/circuits/provider.html +++ b/netbox/templates/circuits/provider.html @@ -41,11 +41,11 @@ NOC Contact - {{ object.noc_contact|render_markdown|placeholder }} + {{ object.noc_contact|render_markdown|placeholder }} Admin Contact - {{ object.admin_contact|render_markdown|placeholder }} + {{ object.admin_contact|render_markdown|placeholder }} Circuits diff --git a/netbox/templates/extras/report_result.html b/netbox/templates/extras/report_result.html index 90726d287..e2f89a180 100644 --- a/netbox/templates/extras/report_result.html +++ b/netbox/templates/extras/report_result.html @@ -78,7 +78,7 @@ {% endif %} - {{ message|render_markdown }} + {{ message|render_markdown }} {% endfor %} {% endfor %} diff --git a/netbox/templates/extras/script_result.html b/netbox/templates/extras/script_result.html index 3cbd0c611..15c446492 100644 --- a/netbox/templates/extras/script_result.html +++ b/netbox/templates/extras/script_result.html @@ -74,7 +74,7 @@ {{ forloop.counter }} {% log_level log.status %} - {{ log.message|render_markdown }} + {{ log.message|render_markdown }} {% empty %} diff --git a/netbox/templates/inc/panels/comments.html b/netbox/templates/inc/panels/comments.html index bfacb25bf..3219a25a5 100644 --- a/netbox/templates/inc/panels/comments.html +++ b/netbox/templates/inc/panels/comments.html @@ -4,7 +4,7 @@
Comments
-
+
{% if object.comments %} {{ object.comments|render_markdown }} {% else %} diff --git a/netbox/utilities/templatetags/helpers.py b/netbox/utilities/templatetags/helpers.py index db9c40fc5..47e341400 100644 --- a/netbox/utilities/templatetags/helpers.py +++ b/netbox/utilities/templatetags/helpers.py @@ -59,6 +59,10 @@ def render_markdown(value): # Render Markdown html = markdown(value, extensions=['fenced_code', 'tables', StrikethroughExtension()]) + # If the string is not empty wrap it in rendered-markdown to style tables + if html: + html = f'
{html}
' + return mark_safe(html)