diff --git a/tildes/scss/_base.scss b/tildes/scss/_base.scss index 922f078..af03ec0 100644 --- a/tildes/scss/_base.scss +++ b/tildes/scss/_base.scss @@ -50,6 +50,11 @@ dl dd { font-size: 0.7rem; } +details:not([open]) { + cursor: pointer; + display: inline-block; +} + // Fixes a Chrome bug that seems to treat children of
as having // box-sizing: content-box. See Known issues: https://caniuse.com/#feat=details details * { diff --git a/tildes/scss/_placeholders.scss b/tildes/scss/_placeholders.scss index 4efba61..78f1313 100644 --- a/tildes/scss/_placeholders.scss +++ b/tildes/scss/_placeholders.scss @@ -11,6 +11,12 @@ } } + details { + margin-bottom: 0.4rem; + padding: 0.2rem 0.4rem; + border: 1px dotted; + } + hr { margin-left: 0; max-width: $paragraph-max-width; diff --git a/tildes/scss/modules/_topic.scss b/tildes/scss/modules/_topic.scss index 5201f47..d12a603 100644 --- a/tildes/scss/modules/_topic.scss +++ b/tildes/scss/modules/_topic.scss @@ -182,7 +182,7 @@ line-height: 0.8rem; } - summary::after { + > summary::after { font-style: italic; content: "Re-collapse topic text"; display: none; diff --git a/tildes/tildes/lib/markdown.py b/tildes/tildes/lib/markdown.py index b393e3d..e1dcda4 100644 --- a/tildes/tildes/lib/markdown.py +++ b/tildes/tildes/lib/markdown.py @@ -63,6 +63,7 @@ HTML_TAG_WHITELIST = ( "br", "code", "del", + "details", "em", "h1", "h2", @@ -80,6 +81,7 @@ HTML_TAG_WHITELIST = ( "small", "strong", "sub", + "summary", "sup", "span", "table", @@ -94,6 +96,7 @@ PROTOCOL_WHITELIST = ("http", "https", "mailto") HTML_ATTRIBUTE_WHITELIST_DEFAULT = { "a": ["href", "title"], + "details": ["open"], "ol": ["start"], "td": ["align"], "th": ["align"],