diff --git a/briar-desktop/src/main/kotlin/org/briarproject/briar/desktop/blog/HtmlText.kt b/briar-desktop/src/main/kotlin/org/briarproject/briar/desktop/blog/HtmlText.kt index b7871dd913baac54135b81d6ae14f3c8ef690ac0..daa690139971b52a23f6d38eadec60acbfc06c25 100644 --- a/briar-desktop/src/main/kotlin/org/briarproject/briar/desktop/blog/HtmlText.kt +++ b/briar-desktop/src/main/kotlin/org/briarproject/briar/desktop/blog/HtmlText.kt @@ -97,9 +97,10 @@ fun HtmlText( // "a", "b"/"strong", "i"/"em"/"cite", "u", "strike", "sub", "sup", "q", "small" // "ul", "ol", "li" // "br", "p", "blockquote", "pre", + // "dd", "dl", "dt", // Elements from Jsoup's safelist we could still add support for: - // "dd", "dl", "dt", "span" + // "span" val h1 = MaterialTheme.typography.h1 val h2 = MaterialTheme.typography.h2 @@ -298,7 +299,16 @@ fun HtmlText( withinPre = false pop() } - ) + ), + // Implementation for description lists. Ignore "dl" and just add indent for "dt" and "dd". + "dt" to HtmlNode( + start = { pushIndent(0.sp) }, + end = { popIndent() } + ), + "dd" to HtmlNode( + start = { pushIndent(20.sp) }, + end = { popIndent() } + ), ) val doc = Jsoup.parse(html)