Open
Description
MWE
local lunamark = require("lunamark")
local opts = {
line_blocks = true,
pipe_tables = true,
}
local writer = lunamark.writer.html.new(opts)
local parse = lunamark.reader.markdown.new(writer, opts)
print("--------------- Test 1 ---------------")
local doc1 = parse([[
| Verse 1
| Verse 2
|
| Verse 3
]])
print(doc1)
print("--------------- Test 2 ---------------")
local doc2 = parse([[
| Verse 1
|
| Verse 2
| Verse 3
]])
print(doc2)
Results:
- Test 1 is parsed as a line blocks
- Test 2 is parsed as a table
--------------- Test 1 ---------------
<div class="line-block">Verse 1<br />
Verse 2<br />
<br />
Verse 3</div>
--------------- Test 2 ---------------
<table>
<thead>
<tr class="header">
</tr>
</thead>
<tbody>
<tr class="odd">
</tr>
<tr class="even">
</tr>
</tbody>
</table>
Well, there is some sort of ambiguity here, and I am not sure that just changing the parsing order is what one would expect in all cases.
Metadata
Metadata
Assignees
Labels
No labels