CottageLabs/cl

Tabs and some blank lines cause major render errors

Closed this issue · 2 comments

Tabs and some blank lines (which maybe just contain the tab character?) cause major rendering errors on the resulting web page. These vary from a * erroneously appearing in the content (see #49 ) to HTML entity escaping all of the content, and sometimes makes accessing the underlying etherpad via the website impossible (probably due to mis-matched div tags resulting from the other div being inadvertantly html escaped).

Use of spaces instead of tabs seems to be ok, although it is easy to forget to use them instead of hitting the tab button.

This problem is relatively urgently in need of a fix, as it is causing the creation of complex pages to be prohibitively difficult (especially if debugging of the layout is required).

Possible fix might be to pre-process the page and strip tabs before sending it to the markdown renderer. This might cause other features of the pages to break (such as when tabs are legitimately used to indent code snippets), so we would need to verify whether this affects any existing pages, or find an alternative solution.

etherpads for some reason pass \t as * and * is sometimes used by markdown. When * is seen by markdown or raw text is tabbed, then it will still be processed as such. However, if *< is seen, e.g. a tab prior to some HTML, then it will now be stripped and replaced with just < so HTML will work properly.

This has got considerably better, thanks, but there are a couple of issues still:

  • when there are tabs not followed by anything, then we still get *s
  • when there are blank lines with tabs in them in between html markup it breaks the layout. This happens a lot because etherpad auto-indents for you when you are already tab indented.

Can we strip all *s that aren't followed by anything (or followed only by whitespace)?