Skip to content
Snippets Groups Projects
Verified Commit 0133f74b authored by Sebastian's avatar Sebastian
Browse files

Implement HTML description lists

parent 7fb2b19f
No related branches found
No related tags found
1 merge request!366Add support for HTML blog posts
Pipeline #15428 passed
...@@ -97,9 +97,10 @@ fun HtmlText( ...@@ -97,9 +97,10 @@ fun HtmlText(
// "a", "b"/"strong", "i"/"em"/"cite", "u", "strike", "sub", "sup", "q", "small" // "a", "b"/"strong", "i"/"em"/"cite", "u", "strike", "sub", "sup", "q", "small"
// "ul", "ol", "li" // "ul", "ol", "li"
// "br", "p", "blockquote", "pre", // "br", "p", "blockquote", "pre",
// "dd", "dl", "dt",
// Elements from Jsoup's safelist we could still add support for: // Elements from Jsoup's safelist we could still add support for:
// "dd", "dl", "dt", "span" // "span"
val h1 = MaterialTheme.typography.h1 val h1 = MaterialTheme.typography.h1
val h2 = MaterialTheme.typography.h2 val h2 = MaterialTheme.typography.h2
...@@ -298,7 +299,16 @@ fun HtmlText( ...@@ -298,7 +299,16 @@ fun HtmlText(
withinPre = false withinPre = false
pop() 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) val doc = Jsoup.parse(html)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment