- we can't just look at the len of the string (~ #bytes) - that breaks down for tables containing characters consisting of multiple bytes. This handles more (still not all) cases and is good enough for now - add _ to allowed tag chars - also require space between headline and tags - links (link itself, not the description) spanning multiple lines are not supported - otherwise we would have to take care of splitting link and adding indentation for org pretty printing - and that sounds like such an edge case that it seems cleaner to forbid them
153 lines
2.5 KiB
HTML
153 lines
2.5 KiB
HTML
<figure>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th class="align-right">a</th>
|
||
<th class="align-right">b</th>
|
||
<th class="align-right">c</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td class="align-right">1</td>
|
||
<td class="align-right">2</td>
|
||
<td class="align-right">3</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<figcaption>
|
||
table with separator before and after header
|
||
</figcaption>
|
||
</figure>
|
||
<figure>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th class="align-right">a</th>
|
||
<th class="align-right">b</th>
|
||
<th class="align-right">c</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td class="align-right">1</td>
|
||
<td class="align-right">2</td>
|
||
<td class="align-right">3</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<figcaption>
|
||
table with separator after header
|
||
</figcaption>
|
||
</figure>
|
||
<figure>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Character</th>
|
||
<th>Org</th>
|
||
<th>Rendered HTML</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>Hyphen</td>
|
||
<td><code class="verbatim">a - b</code></td>
|
||
<td>a - b</td>
|
||
</tr>
|
||
<tr>
|
||
<td>Ndash</td>
|
||
<td><code class="verbatim">a -- b</code></td>
|
||
<td>a – b</td>
|
||
</tr>
|
||
<tr>
|
||
<td>Mdash</td>
|
||
<td><code class="verbatim">a --- b</code></td>
|
||
<td>a — b</td>
|
||
</tr>
|
||
<tr>
|
||
<td>Ellipsis</td>
|
||
<td><code class="verbatim">a ... b</code></td>
|
||
<td>a … b</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<figcaption>
|
||
table with unicode characters
|
||
</figcaption>
|
||
</figure>
|
||
<figure>
|
||
<table>
|
||
<tbody>
|
||
<tr>
|
||
<td class="align-right">1</td>
|
||
<td class="align-right">2</td>
|
||
<td class="align-right">3</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<figcaption>
|
||
table without header (but separator before)
|
||
</figcaption>
|
||
</figure>
|
||
<figure>
|
||
<table>
|
||
<tbody>
|
||
<tr>
|
||
<td class="align-right">1</td>
|
||
<td class="align-right">2</td>
|
||
<td class="align-right">3</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<figcaption>
|
||
table without header
|
||
</figcaption>
|
||
</figure>
|
||
<figure>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th class="align-left">left aligned</th>
|
||
<th class="align-right">right aligned</th>
|
||
<th class="align-center">center aligned</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td class="align-left">42</td>
|
||
<td class="align-right">42</td>
|
||
<td class="align-center">42</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="align-left">foobar</td>
|
||
<td class="align-right">foobar</td>
|
||
<td class="align-center">foobar</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<figcaption>
|
||
table with aligned columns
|
||
</figcaption>
|
||
</figure>
|
||
<figure>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th class="align-right">long column a</th>
|
||
<th class="align-right">long column b</th>
|
||
<th class="align-right">long column c</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td class="align-right">1</td>
|
||
<td class="align-right">2</td>
|
||
<td class="align-right">3</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<figcaption>
|
||
table with right aligned columns (because numbers)
|
||
</figcaption>
|
||
</figure>
|