GitbookIO / kramed

A markdown (kramdown compatible) parser and compiler. Built for speed. (Fork of marked)
MIT License
223 stars 47 forks source link

Add table captioning to table syntax #12

Open aepstein opened 9 years ago

aepstein commented 9 years ago

In books, tables are generally accompanied by a caption. HTML specification is to have a caption tag right above the . Right now, to add a caption the whole table needs to be in HTML. This patch adds a markdown convention as follows:

'''
Table 1<br/>
Table shows some data
'''
Heading 1 | Heading 2
----------|-----------
Data 1    |Data 2

which renders to:

<table>
<caption>Table 1<br/>Table shows some data</caption>
<thead>....

Patch includes modified table tests to capture this functionality.