karlb / smu

Simple MarkUp - markdown/commonmark like syntax
http://karlb.github.io/smu/
MIT License
55 stars 5 forks source link

Add table parser #11

Closed karlb closed 2 years ago

karlb commented 2 years ago

By adding the code from https://github.com/karlb/smu/issues/5.

Remaining TODO:

Closes https://github.com/karlb/smu/issues/5.

N-R-K commented 2 years ago

Find out why the table parser does not proceed past the headings in the test case

Should be fixed by https://github.com/karlb/smu/pull/11/commits/492b141d03855054bb3f840a369485a80b1bd4ae

Scratch that, just noticed that the cells aren't properly aligned on the first table.

N-R-K commented 2 years ago

First time seeing git diff being used for catching regression in tests. Very lateral thinking, I like it.

karlb commented 2 years ago

Thanks @bztsrc and @N-R-K!

N-R-K commented 2 years ago

One more note, a lot of the other parsers allow the table to be indented ^0 while our parser is strict about the table beginning at the start of the line surrounds the table with <p> .. </p> when the table is indented.

I think being strict is fine because it's simpler. So the current behavior is OK by me until/unless CommonMark has a specification for table syntax. Pointing it out just in case.