kjdev / hoextdown

Hoextdown is an extension to Hoedown
MIT License
23 stars 15 forks source link

Add a multiline table extension, controlled by a flag. #27

Closed jasharpe closed 8 years ago

jasharpe commented 8 years ago

(Further details here: https://github.com/jasharpe/hoextdown/wiki/Multiline-Table-Syntax-Extension)

In our usage of tables in Hoedown, we are struggling with very wide tables that result because there is no mechanism for splitting cell contents across multiple lines. This patch provides a flexible way of splitting cell contents across multiple rows, with two basic components (continued rows and optional row separators). These two components can be used together to accomplish the task in a couple different styles, according to the discretion of the document author.

We considered many types of syntax in developing this proposal, and settled on this one as being the simplest, most lightweight extension of existing tables, that still felt like good Markdown. Please see the following document for a more complete justification of the choices made, along with many alternatives syntaxes considered: https://github.com/jasharpe/hoextdown/wiki/Multiline-Table-Syntax-Extension

Summary of changes (again, see the linked document above for details and detailed examples):

Summary of implementation changes:

For the most part, all significant changes have been guarded by the --multiline-tables flag, however, a couple of minor changes were made outside these sections (these will make more sense after reading the patch):

These changes should have a very minor affect on users who don't use --multiline-tables.

I've introduced an extensive multiline table test suite to verify this change. I've also added additional table tests (the existing ones were pretty sparse) to make sure nothing is broken.

Please let me know if you have concerns about adding this as an extension in Hoextdown.

Thanks!

(Further details here: https://github.com/jasharpe/hoextdown/wiki/Multiline-Table-Syntax-Extension)

kjdev commented 8 years ago

Thanks. That's a great code.