mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-25 18:08:38 -06:00
Fix #8097: Re-fix markdown table rendering
This commit is contained in:
parent
4a3bc8d365
commit
3a54ecb522
BIN
netbox/project-static/dist/netbox-dark.css
vendored
BIN
netbox/project-static/dist/netbox-dark.css
vendored
Binary file not shown.
BIN
netbox/project-static/dist/netbox-light.css
vendored
BIN
netbox/project-static/dist/netbox-light.css
vendored
Binary file not shown.
BIN
netbox/project-static/dist/netbox-print.css
vendored
BIN
netbox/project-static/dist/netbox-print.css
vendored
Binary file not shown.
@ -965,6 +965,19 @@ div.card-overlay {
|
|||||||
max-width: unset;
|
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
|
// Preformatted text blocks
|
||||||
td pre {
|
td pre {
|
||||||
margin-bottom: 0
|
margin-bottom: 0
|
||||||
|
@ -41,11 +41,11 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">NOC Contact</th>
|
<th scope="row">NOC Contact</th>
|
||||||
<td class="rendered-markdown">{{ object.noc_contact|render_markdown|placeholder }}</td>
|
<td>{{ object.noc_contact|render_markdown|placeholder }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">Admin Contact</th>
|
<th scope="row">Admin Contact</th>
|
||||||
<td class="rendered-markdown">{{ object.admin_contact|render_markdown|placeholder }}</td>
|
<td>{{ object.admin_contact|render_markdown|placeholder }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">Circuits</th>
|
<th scope="row">Circuits</th>
|
||||||
|
@ -78,7 +78,7 @@
|
|||||||
<span class="muted">—</span>
|
<span class="muted">—</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td class="rendered-markdown">{{ message|render_markdown }}</td>
|
<td>{{ message|render_markdown }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -74,7 +74,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>{{ forloop.counter }}</td>
|
<td>{{ forloop.counter }}</td>
|
||||||
<td>{% log_level log.status %}</td>
|
<td>{% log_level log.status %}</td>
|
||||||
<td class="rendered-markdown">{{ log.message|render_markdown }}</td>
|
<td>{{ log.message|render_markdown }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% empty %}
|
{% empty %}
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<h5 class="card-header">
|
<h5 class="card-header">
|
||||||
Comments
|
Comments
|
||||||
</h5>
|
</h5>
|
||||||
<div class="card-body rendered-markdown">
|
<div class="card-body">
|
||||||
{% if object.comments %}
|
{% if object.comments %}
|
||||||
{{ object.comments|render_markdown }}
|
{{ object.comments|render_markdown }}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
@ -59,6 +59,10 @@ def render_markdown(value):
|
|||||||
# Render Markdown
|
# Render Markdown
|
||||||
html = markdown(value, extensions=['fenced_code', 'tables', StrikethroughExtension()])
|
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'<div class="rendered-markdown">{html}</div>'
|
||||||
|
|
||||||
return mark_safe(html)
|
return mark_safe(html)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user