Closed yfakariya closed 3 years ago
Thanks for the PR! Can you please elaborate and show us how this change affects the table layout with examples so that we don't have to guess from your changes at https://github.com/yfakariya/review.js-vscode/pull/16/ ? I am somewhat concerned about the offset changes, especially that whether it impacts preview outputs to users and they make sense or not. I cannot guess that from the diffs.
You're absolutely right.
In summary, this is a bug fix.
This is because preprocess skipped tab only "text" between inline elements, and builder did not consider newlines between inline elements. I found this bug when I wrote a table which represents mappings of some code constructs.
Consider a following table which is written by Re:VIEW (I will show horizontal tab as '
HEADER1 <TAB> HEADER2<TAB> HEADER3
---------------------------------------------------
A <TAB> @<tt>{B} <TAB> @<em>{C} and @<strong>{D}
E <TAB> F <TAB> G <TAB>
The table should be rendered like following:
HEADER1 | HEADER2 | HEADER3 |
---|---|---|
A | B |
C and D |
E | F | G |
with following HTML:
<table>
<tr><th>HEADER</th><th>HEADER2</th><th>HEADER3</th></tr>
<tr><td>A</td><td><code class="tt">B</code></td><td><em>C</em>and<strong>D</strong></td></tr>
<tr><td>E</td><td>F</td><td>G</td></tr>
</table>
However, before v0.9.1, it will be rendered like:
HEADER1 | HEADER2 | HEADER3 | |
---|---|---|---|
A | B CandDE |
F | G |
with following HTML:
<table>
<tr><th>HEADER</th><th>HEADER2</th><th>HEADER3</th></tr>
<tr><td>A</td><td><code class="tt">B</code><em>C</em>and<strong>D</strong><td>E</td><td>F</td><td>G</td></tr>
</table>
https://github.com/yfakariya/review.js-vscode/pull/16 fixes this bug.
Awesome. Thanks!
This fixes table layout contains inline elements.