Skip to content

Initial html support II

Maximiliano requested to merge msandova/fractal:html-support into master

Following !399 (closed). Depends on html2pango!13 (merged).

Some images

image

image

image

image

image

image

image

Comparison with that other app:

image image

TODO

  • Add support for emotes. This was working already
  • Escape quotes on code blocks, to be more precise, don't.
  • Remove the use of the fork once merged

Issuess known so far:

  • <T> in text is not getting rendered at all.-

  • html inside code blocks gets rendered incorrectly, http:x gets displayed as <a href="http:x">http:x</a> (Depends on html2pango!14 (merged))

  • The Code blocks are not wrapping properly

  • The way if separates strings is very hacky, it joins texts by the rule 'if url add white space' otherwise 'add newline' this should take in consideration if the next element is or is it not a url.

  • For some reason that it is beyond me I see citations from a handful of people empty

  • Inline code blocks have an extra newline

  • Error when typing <del>Something</del>. Message not being rendered. This was happening because Fractal will get these as

"formatted_body": "<!-- raw HTML omitted -->Something<!-- raw HTML omitted -->"
  • Right click on top of a message should display a menu. Reply, Copy Text, View Source This only happens on some html rendered messages.

Issues out of the scope of the MR:

  • Code would benefit from better css rules
  • When the code blocks end in parents/brackets they are highlighted. This could be easily fixed by adding and invisible character at the end of those blocks, but I expect there is a better option related to sourceview. It is the same behaviour as when typing such characters.
  • There is a box inserted as a background by codeview which hides any css applied to it.

Future work

  1. Detect code lang, this should not be hard, but requires another change to Pango2html breaking the API
  2. Start unordered lists with the same index as typed, ditto requires changes to Pango2html, at the moment all lists start with 1.
  3. In replies users appear as In reply to @handle:matrix.org, this could be more or less to tackle as the string is localized, but ideally it should only be @handle, ditto requires breaking html2pango API. Replies are in a <mx-reply>.
  4. Be able to style inline code
Edited by Maximiliano

Merge request reports