friendica / red

The Red Matrix
MIT License
214 stars 50 forks source link

Newlines should not be replaced with <br> inside [table] #860

Closed pafcu closed 9 years ago

pafcu commented 9 years ago

The following bbcode:

[table]
[tr][td]Row 1[/td][/tr]
[tr][td]Row 2[/td][/tr]
[/table]

produces the incorrect HTML

<table><br /><tr><td>Row 1</td></tr><br /><tr><td>Row 2</td></tr><br /></table>

Note the inserted <br />. Because <br> is not allowed inside <table>, at least Firefox displays them before the table, resulting in multiple blank linkes in front of tables. This makes long tables problematic, as the user is required to scroll down past the empty lines to see the table.

The workaround is to write the entire table on one line:

[table][tr][td]Row 1[/td][/tr][tr][td]Row 2[/td][/tr][/table]

However, this is not good when working with long tables.

The key to fix this issue is probably in include/bbcode.php

ghost commented 9 years ago

This issue was moved to redmatrix/redmatrix#296