Skip to content

Commit b0ce3d0

Browse files
authored
Merge pull request #744 from hackmdio/add-more-html5-tags
Support more html5 tags and styles
2 parents 912cce2 + ea118c2 commit b0ce3d0

2 files changed

Lines changed: 17 additions & 5 deletions

File tree

public/css/markdown.css

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,22 @@
190190
}
191191

192192
/* Make details boxes look like on GitHub */
193+
.markdown-body summary {
194+
display: list-item;
195+
}
196+
197+
.markdown-body summary:focus {
198+
outline: none;
199+
}
200+
193201
.markdown-body details summary {
194202
cursor: pointer;
195203
}
196204

197-
.markdown-body summary {
198-
display: list-item;
205+
.markdown-body details:not([open]) > *:not(summary) {
206+
display: none;
207+
}
208+
209+
.markdown-body figure {
210+
margin: 1em 40px;
199211
}

public/js/render.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ whiteList['style'] = []
1919
whiteList['kbd'] = []
2020
// allow ifram tag with some safe attributes
2121
whiteList['iframe'] = ['allowfullscreen', 'name', 'referrerpolicy', 'sandbox', 'src', 'width', 'height']
22-
// allow details tag
23-
whiteList['details'] = []
24-
// allow summary tag for details
22+
// allow summary tag
2523
whiteList['summary'] = []
2624
// allow ruby tag
2725
whiteList['ruby'] = []
26+
// allow rp tag for ruby
27+
whiteList['rp'] = []
2828
// allow rt tag for ruby
2929
whiteList['rt'] = []
3030
// allow figure tag

0 commit comments

Comments
 (0)