forked from hoedown/hoedown
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix rendering in table with empty cells
`find_emph_char` returns 0 if the char specified is not found in the current line, but this is also what happens when there's an empty cell. This patch adds logic to work around this problem. See MacDownApp/macdown#321
- Loading branch information
Showing
4 changed files
with
101 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<h1>Standard table</h1> | ||
|
||
<table> | ||
<thead> | ||
<tr> | ||
<th>headline1</th> | ||
<th>headline2</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>123</td> | ||
<td></td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
|
||
<h1>Cell alignment</h1> | ||
|
||
<table> | ||
<thead> | ||
<tr> | ||
<th style="text-align: left">headline1</th> | ||
<th style="text-align: center">headline2</th> | ||
<th style="text-align: right">headline3</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td style="text-align: left">123</td> | ||
<td style="text-align: center"></td> | ||
<td style="text-align: right"></td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
|
||
<h1>Malformed table: missing cell at row in body</h1> | ||
|
||
<table> | ||
<thead> | ||
<tr> | ||
<th>headline1</th> | ||
<th>headline2</th> | ||
<th>headline3</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>12</td> | ||
<td></td> | ||
<td></td> | ||
</tr> | ||
<tr> | ||
<td>34</td> | ||
<td></td> | ||
<td></td> | ||
</tr> | ||
<tr> | ||
<td>56</td> | ||
<td></td> | ||
<td></td> | ||
</tr> | ||
</tbody> | ||
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Standard table | ||
|
||
|headline1|headline2| | ||
|---------|---------| | ||
|123 | | | ||
|
||
|
||
# Cell alignment | ||
|
||
|headline1|headline2|headline3| | ||
|:-------|:------:|------:| | ||
|123||| | ||
|
||
|
||
# Malformed table: missing cell at row in body | ||
|
||
|headline1|headline2|headline3| | ||
|-------|-------|-------| | ||
|12 | ||
|34|| | ||
|56| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters