From 711a11ce2344a7d3b2e07004edf33949ecc3b2af Mon Sep 17 00:00:00 2001 From: Max Wu Date: Mon, 26 Feb 2018 20:54:57 +0800 Subject: [PATCH 1/3] Remove manual allow details tag since default already allow it Signed-off-by: Max Wu --- public/js/render.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/public/js/render.js b/public/js/render.js index 860f82725..eb6852d1f 100644 --- a/public/js/render.js +++ b/public/js/render.js @@ -19,9 +19,7 @@ whiteList['style'] = [] whiteList['kbd'] = [] // allow ifram tag with some safe attributes whiteList['iframe'] = ['allowfullscreen', 'name', 'referrerpolicy', 'sandbox', 'src', 'width', 'height'] -// allow details tag -whiteList['details'] = [] -// allow summary tag for details +// allow summary tag whiteList['summary'] = [] // allow ruby tag whiteList['ruby'] = [] From 95e9f96aa0fb8a0112ec3b01f1ad79e1d76224ba Mon Sep 17 00:00:00 2001 From: Max Wu Date: Mon, 26 Feb 2018 20:55:10 +0800 Subject: [PATCH 2/3] Update to allow rp tag for ruby Signed-off-by: Max Wu --- public/js/render.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public/js/render.js b/public/js/render.js index eb6852d1f..23b8934ec 100644 --- a/public/js/render.js +++ b/public/js/render.js @@ -23,6 +23,8 @@ whiteList['iframe'] = ['allowfullscreen', 'name', 'referrerpolicy', 'sandbox', ' whiteList['summary'] = [] // allow ruby tag whiteList['ruby'] = [] +// allow rp tag for ruby +whiteList['rp'] = [] // allow rt tag for ruby whiteList['rt'] = [] // allow figure tag From ea118c2ec8089fdde95cdbc71d19d05d72d7e673 Mon Sep 17 00:00:00 2001 From: Max Wu Date: Mon, 26 Feb 2018 21:05:13 +0800 Subject: [PATCH 3/3] Update styles of details, summary and figure Signed-off-by: Max Wu --- public/css/markdown.css | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/public/css/markdown.css b/public/css/markdown.css index 36e45781c..eaa9ab5c8 100644 --- a/public/css/markdown.css +++ b/public/css/markdown.css @@ -190,10 +190,22 @@ } /* Make details boxes look like on GitHub */ +.markdown-body summary { + display: list-item; +} + +.markdown-body summary:focus { + outline: none; +} + .markdown-body details summary { cursor: pointer; } -.markdown-body summary { - display: list-item; +.markdown-body details:not([open]) > *:not(summary) { + display: none; +} + +.markdown-body figure { + margin: 1em 40px; }