# TIP: Lightweight Rich Text View

DevFeed: [TIP: Lightweight Rich Text View](<https://devfeed.tech/articles/tip-lightweight-rich-text-view-19586.md>)

Original publisher: [Read original article](<https://www.codenameone.com/blog/tip-lightweight-rich-text-view/>)

Author: Shai Almog

Published: 2017-02-19T00:00:00Z

Content type: tutorial

Language: en

Sources: [CodeName One](<https://devfeed.tech/sources/codename-one.md>)

Topics: [cross-platform](<https://devfeed.tech/topics/cross-platform.md>), [HTML](<https://devfeed.tech/topics/html.md>), [Parsing](<https://devfeed.tech/topics/parsing.md>), [XML](<https://devfeed.tech/topics/xml.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [cross-platform](<https://devfeed.tech/tags/cross-platform.md>), [demo](<https://devfeed.tech/tags/demo.md>), [html](<https://devfeed.tech/tags/html.md>), [parsing](<https://devfeed.tech/tags/parsing.md>), [simulator](<https://devfeed.tech/tags/simulator.md>), [syntax](<https://devfeed.tech/tags/syntax.md>)

## AI overview

This article presents a proof of concept for a lightweight rich-text view in Codename One using a simple HTML-based syntax. It supports bold, italic, and line breaks while avoiding more complex features such as links, font sizes, and colors.

## Source excerpt

A very common request is support for rich text in Codename One, this is hard to do in a generic/performant cross platform way but can be done as I explained in my answer here. This is pretty common though so it might be worth it doing this in a generic way. Building a "proper" rich text view would take some work as there are many edge cases & complexities. However, since we already have an XML parser that's perfectly capable of parsing HTML I decided to try a very simple HTML based syntax just to show how easy it would be to create something generic like this. I avoided the "link" use case as that would require some link handler code and I avoided font sizes/colors as I didn't want to go into attributes and related complexities.