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

more elaborate example in BlogPostView

parent df220325
No related branches found
No related tags found
1 merge request!366Add support for HTML blog posts
...@@ -88,7 +88,35 @@ fun main() = preview { ...@@ -88,7 +88,35 @@ fun main() = preview {
) )
BlogPostView(post, {}, {}) BlogPostView(post, {}, {})
val htmlPost = getRandomBlogPostItem( val htmlPost = getRandomBlogPostItem(
text = "<h1>HTML post</h1><p>This is a html blog post.\n\nIt has <a href=\"https://web.archive.org\">one author</a> and no comments.</p>", text = """
<h1>Headline</h1>
<p>some text</p>
<h2>second headline</h2>
<p>
Hello World
<b>bold</b>, <i>italic</i>, <u>underline</u>, <b><i><u>all three</u></i></b>,
also <strike>strikethrough</strike>
</p>
<p>
This paragraph<br/>
contains a <a href="https://google.com">link to Google</a>
</p>
<p>
Some fancy formatting: <sub>subscript</sub> and <sup>superscript</sup> are supported.
</p>
<blockquote>
Something very important, worth citing
</blockquote>
<code>
a code block
</code>
<p>
<ol>
<li>foo</li>
<li>bar</li>
</ol>
</p>
""".trimIndent(),
time = System.currentTimeMillis() - 750_000 time = System.currentTimeMillis() - 750_000
) )
BlogPostView(htmlPost, {}, {}) BlogPostView(htmlPost, {}, {})
......
...@@ -78,7 +78,8 @@ fun main() = preview { ...@@ -78,7 +78,8 @@ fun main() = preview {
<li>foo</li> <li>foo</li>
<li>bar</li> <li>bar</li>
</ol> </ol>
</p>""".trimIndent() </p>
""".trimIndent()
HtmlText(testHtml) { HtmlText(testHtml) {
println(it) println(it)
......
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