element-hq / riot-android

A glossy Matrix collaboration client for Android
Apache License 2.0
1.4k stars 394 forks source link

Text starting with enumeration gets its numbers replaced to start with 1 #2557

Open zwieberl opened 6 years ago

zwieberl commented 6 years ago

The text 3. Whatever gets automagically replaced by 1. Whatever after hitting the send-button.

I tested this on a sailfish-device and on a normal Android-device. This does not happen with riot-desktop.

bmarty commented 6 years ago

Thanks for reporting. There are several issue with the same pb, it's a really annoying point. We have to fix this

bmarty commented 6 years ago

Also is you type "3. test" in Riot web, you will notice that it is replaced by a numbered list. Not sure it is an expected behavior... And if you type "123456.", it's even worth...

RotBolt commented 5 years ago

Currently if type

  1. text 1
  2. text 2

changes to

  • text 1
  • text 2

changes to bulleted list

RotBolt commented 5 years ago

@bmarty I think the problem is in the parser itself. Currently parser markDownToHtml() converts something like

  1. Text

to

<ol>
<li>Text</li>
</ol>

which inturn changes to

  • Text

this is done by convertToHtml() wriiten in js in markdown.js which in turn uses marked.js currently java<->js interface is used to convert to html. Changes have to be done under marked.js

we could use this MarkDown lib It doesnt use WebView implementation for converting to Markdown. Hence this could be fast

bmarty commented 5 years ago

Markwon is used in RiotX, I'm not sure we will update anything on this subject in Riot