Skip to content
This repository has been archived by the owner on Jan 5, 2025. It is now read-only.

Multiline table functionality #93

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cleverdripper
Copy link

Adds functionality to handle markdown tables that have rows that span multiple lines of source.

This enables the source code to look considerably cleaner for table cells that have a lot of content. For example, instead of having

Column A  | Column B
----------|---------
row a     | Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
more a... | Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

You can do

Column A  | Column B
----------+----------
row a     | Lorem ipsum dolor sit amet, consectetur adipisicing elit,
          | sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
          | Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
etc       | nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
          | reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
          | pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
          | culpa qui officia deserunt mollit anim id est laborum.
----------+----------
more a... | Lorem ipsum dolor sit amet, consectetur adipisicing elit,
          | sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
          | Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
etc       | nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
          | reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
          | pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
          | culpa qui officia deserunt mollit anim id est laborum.

The only difference is that you use + in the underline for the column headers instead of a |, and when you want a new row you use ---+---. The two tables above will end up translated to the same HTML table.

This does not break existing Markdown features, and it stays consistent with Markdown's goal to be readable in plain-text form.

Where it never stops reading.

Also made the regexes for determining row separators more tolerant.
@bhollis
Copy link
Owner

bhollis commented Jul 8, 2013

Thanks @cleverdripper. If you don't mind, I'm going to park this pull request until I'm starting to pull together the 1.0 release, where I'll be considering new features and Markdown syntax extensions.

@cleverdripper
Copy link
Author

@bhollis No problem, thanks for considering. Great work on maruku.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants