mdless icon indicating copy to clipboard operation
mdless copied to clipboard

Table is not rendering correctly.

Open ToadJamb opened this issue 5 months ago • 1 comments

I have the following markdown table:

+---------+-----------+-------------+-------------+-------------+---------------+---------------+-----+
|  stat   |   range   |      1      |      2      |      3      |       4       |       5       | min |
|---------+-----------+-------------+-------------+-------------+---------------+---------------+-----|
|    %    |   5 -   7 |  10 -    14 |  15 -    21 |  20 -    28 |    25 -    35 |    30 -    42 |  19 |
|  speed  |   5 -   6 |  10 -    12 |  15 -    18 |  20 -    24 |    25 -    30 |    30 -    36 |  17 |
| acc/res |   9 -  12 |  18 -    24 |  27 -    36 |  36 -    48 |    45 -    60 |    54 -    72 |  32 |
| att/def |  15 -  30 |  30 -    60 |  45 -    90 |  60 -   120 |    75 -   150 |    90 -   180 |     |
| hp flat | 200 - 565 | 400 - 1,130 | 600 - 1,696 | 800 - 2,260 | 1,000 - 2,825 | 1,200 - 3,390 |     |
+---------+-----------+-------------+-------------+-------------+---------------+---------------+-----+

I expect it to be rendered exactly as it is above. Instead, I see this when using mdless:

Image

ToadJamb avatar Jul 23 '25 02:07 ToadJamb

That's not a Markdown table, at least not a standard spec. A standard spec would look like:

|  stat   |     range |           1 |           2 |           3 |        
      4 |             5 |  min |
| :-----: | --------: | ----------: | ----------: | ----------: | 
------------: | ------------: | ---: |
|    %    |   5 -   7 |  10 -    14 |  15 -    21 |  20 -    28 |    25 
-    35 |    30 -    42 |   19 |
|  speed  |   5 -   6 |  10 -    12 |  15 -    18 |  20 -    24 |    25 
-    30 |    30 -    36 |   17 |
| acc/res |   9 -  12 |  18 -    24 |  27 -    36 |  36 -    48 |    45 
-    60 |    54 -    72 |   32 |
| att/def |  15 -  30 |  30 -    60 |  45 -    90 |  60 -   120 |    75 
-   150 |    90 -   180 |      |
| hp flat | 200 - 565 | 400 - 1,130 | 600 - 1,696 | 800 - 2,260 | 1,000 
- 2,825 | 1,200 - 3,390 |      |

Which renders fine. The almost-there aspect of your table confuses mdless' parser.

The format your using looks familiar, but I can't remember which renderer recognizes it. AsciiDoc? Pandoc? mdless uses Discount, and doesn't handle other syntax very well.

-Brett

ttscoff avatar Jul 23 '25 08:07 ttscoff