views:

25

answers:

0

Tables in markdown are a lesser known feature and not commonly supported (reddit is currently the only website I know which supports it). Which means any ports of the parsing engine to other languages don't have table's supported.

So does anyone know of a library that does this? Or fancy posting a solution to parsing the following syntax? :P

 # | Track | Artist | Time |
---|-------|--------|------|
 1 | Lies and alibis | Lovage | (3:16) 
 2 | Dissolved girl | Massive Attack | (6:06) 
 3 | Double Bass | Gorillaz | (4:45) 
 4 | Ego tripping at the gates of hell | The Flaming Lips | (4:34) 
 5 | Home | Alexi Murdoch | (5:50) 
 6 | Feel so good | Spacemen 3 | (4:55) 
 7 | Loomer | My Bloody Valentine | (2:38) 
 8 | Hunter | Portishead | (3:58) 
 9 | Girls | Death in vegas | (4:30) 
 10 | Run | Air | (4:14)

To the following...

<table>
    <thead>
        <tr>
            <th> # </th>
            <th> Track </th>
            <th> Artist </th>
            <th> Time </th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td> 1 </td>
            <td> Lies and alibis </td>
            <td> Lovage </td>
            <td> (3:16) </td>
        </tr>
        <tr>
            <td> 2 </td>
            <td> Dissolved girl </td>
            <td> Massive Attack </td>
            <td> (6:06) </td>
        </tr>
        <tr>
            <td> 3 </td>
            <td> Double Bass </td>
            <td> Gorillaz </td>
            <td> (4:45) </td>
        </tr>
        <tr>
            <td> 4 </td>
            <td> Ego tripping at the gates of hell </td>
            <td> The Flaming Lips </td>
            <td> (4:34) </td>
        </tr>
        <tr>
            <td> 5 </td>
            <td> Home </td>
            <td> Alexi Murdoch </td>
            <td> (5:50) </td>
        </tr>
        <tr>
            <td> 6 </td>
            <td> Feel so good </td>
            <td> Spacemen 3 </td>
            <td> (4:55) </td>
        </tr>
        <tr>
            <td> 7 </td>
            <td> Loomer </td>
            <td> My Bloody Valentine </td>
            <td> (2:38) </td>
        </tr>
        <tr>
            <td> 8 </td>
            <td> Hunter </td>
            <td> Portishead </td>
            <td> (3:58) </td>
        </tr>
        <tr>
            <td> 9 </td>
            <td> Girls </td>
            <td> Death in vegas </td>
            <td> (4:30) </td>
        </tr>
        <tr>
            <td> 10 </td>
            <td> Run </td>
            <td> Air </td>
            <td> (4:14) </td>
        </tr>
    </tbody>
</table>​