This is a simple POC to parse a subset of markdown and render it in Android and iOS.
This POC tries to handle the following markdown styles:
- bold:
**bold** - underline:
__underline__ - italic:
_italic_ - hyperlink:
[link text](http://google.com)
- MarkdownParser.kt: exposes a parse() method that returns the copy and a list of entities.
- AndroidMarkdownRenderer.kt: exposes a couple of extension methods to add markdown to a
TextViewandButton.
-
TODO: we need to implement this, probably using NSAttributedString or UIFont. I need to explore this.
-
We welcome contributions :)
Thus, the following copy:
val markdown = "Some text is **bold**. While some text is _italic_. Other is __underlined__. Lastly we have [link](http://google.com)."Used like so in Android:
val textView = findViewById<TextView>(R.id.text_view)
val button = findViewById<Button>(R.id.button)
textView.renderMarkdown(markdown)
button.renderMarkdown(markdown)