Skip to content

Commit 54a41a2

Browse files
authored
Fix Markdown lists rendering and enable extra extensions
1 parent 8526dcc commit 54a41a2

File tree

4 files changed

+31
-2
lines changed

4 files changed

+31
-2
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
### Fixed
9+
- Markdown lists rendering
10+
11+
### Added
12+
- Enable extra extensions for Markdown rendering
13+
14+
### Changed
15+
- Update dependencies
816

917
## [0.5.3] - 2023-06-05
1018
### Fixed

datasette_dashboards/static/dashboards.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,17 @@
7575
height: 100%;
7676
}
7777

78+
.dashboard-card-chart ul {
79+
list-style: initial;
80+
list-style-position: inside;
81+
}
82+
83+
.dashboard-card-chart ol {
84+
list-style: initial;
85+
list-style-position: inside;
86+
list-style-type: decimal;
87+
}
88+
7889
.chart-container {
7990
width: 100%;
8091
height: 70vh;

datasette_dashboards/templates/dashboard_chart.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,12 @@ <h1>{{ dashboard.title }}</h1>
5555
<div class="dashboard-card">
5656
<div id="chart" class="chart-container">
5757
{% if chart.library == 'markdown' %}
58-
{{ render_markdown(chart.display) }}
58+
{{ render_markdown(
59+
chart.display,
60+
extensions=["extra"],
61+
extra_tags=["table", "thead", "tr", "th", "td", "tbody"]
62+
)
63+
}}
5964
{% endif %}
6065
</div>
6166
</div>

datasette_dashboards/templates/dashboard_view.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,12 @@ <h1>{{ dashboard.title }}</h1>
112112

113113
<div id="chart-{{ chart_slug }}" class="dashboard-card-chart">
114114
{% if chart.library == 'markdown' %}
115-
{{ render_markdown(chart.display) }}
115+
{{ render_markdown(
116+
chart.display,
117+
extensions=["extra"],
118+
extra_tags=["table", "thead", "tr", "th", "td", "tbody"]
119+
)
120+
}}
116121
{% endif %}
117122
</div>
118123
</div>

0 commit comments

Comments
 (0)