Search code examples
titaniumappceleratorappcelerator-titanium

Titanium - <ul> and <li> aren't recognized by the html parser


I'm using an html parser for ios: https://github.com/FokkeZB/nl.fokkezb.html2as.widget

and the html property for Android in a Ti.UI.Label

but the <ul> and <li> tags aren't recognized. Is it possible a solution?


Solution

  • As mentioned in the comments, ul and li tags are not supported. Only the native functionality of Attributed String is supported. If you looked at the module it links to Attributed String page at the docs.

    An attributed string guide can be found here and all included types: http://docs.appcelerator.com/platform/latest/#!/guide/Attributed_Strings

    That said, I recommend using either a webview, or better StyledLabel. StyledLabel is a webview with stripped functionality. You can find the module here: https://github.com/appcelerator-archive/ti.styledlabel

    Then you can just set html as a property on the label instead of the text property.

    Even better would be to prevent using HTML and not output HTML from the backend but instead the list itself as an array in a JSON response, and then visually build the page in the app.

    Apps are not really build for HTML