Skip to content

Commit

Permalink
Upgrade Markdown to v3.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremystretch committed Dec 4, 2023
1 parent 115111d commit 2b7cc1e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
5 changes: 2 additions & 3 deletions base_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,8 @@ gunicorn
Jinja2

# Simple markup language for rendering HTML
# https://python-markdown.github.io/change_log/
# mkdocs currently requires Markdown v3.3
Markdown<3.4
# https://python-markdown.github.io/changelog/
Markdown

# File inclusion plugin for Python-Markdown
# https://github.com/cmacmackin/markdown-include
Expand Down
8 changes: 7 additions & 1 deletion netbox/utilities/templatetags/builtins/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from django.utils.html import escape
from django.utils.safestring import mark_safe
from markdown import markdown
from markdown.extensions.tables import TableExtension

from netbox.config import get_config
from utilities.markdown import StrikethroughExtension
Expand Down Expand Up @@ -163,7 +164,12 @@ def render_markdown(value):
return ''

# Render Markdown
html = markdown(value, extensions=['def_list', 'fenced_code', 'tables', StrikethroughExtension()])
html = markdown(value, extensions=[
'def_list',
'fenced_code',
StrikethroughExtension(),
TableExtension(use_align_attribute=True),
])

# If the string is not empty wrap it in rendered-markdown to style tables
if html:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ feedparser==6.0.10
graphene-django==3.0.0
gunicorn==21.2.0
Jinja2==3.1.2
Markdown==3.3.7
Markdown==3.5.1
mkdocs-material==9.4.14
mkdocstrings[python-legacy]==0.24.0
netaddr==0.9.0
Expand Down

0 comments on commit 2b7cc1e

Please sign in to comment.