Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tables not rendering in HTML #346

Open
ilovetogetspamed opened this issue Mar 6, 2020 · 5 comments
Open

Tables not rendering in HTML #346

ilovetogetspamed opened this issue Mar 6, 2020 · 5 comments
Labels

Comments

@ilovetogetspamed
Copy link

I'm trying to get the following MD document to render proper HTML. The ouput is not as I would expect. The tables are not rendering as I would expect. Let me know if I'm doing something wrong.

This is the input file:

CLEANING
=
| No.  | Important Parts for Cleaning    |  Cleaning Cycle | Ref. Figure
| ---:|---|---|---|
| 1 | Around the hook | Every day       | url_for_fig_1
| 2 | Guide rail to the take-up lever | Once a week | url_for_fig_2
| 3 | Around the movable blade and the fixed blade | Once in 3-7 days | url_for_fig_3
| 4 | X-Y drive pulley teeth and timing belt teeth | Once a month

OIL SUPPLY
=
1.  Oil supply   Use the SWF sewing machine oil (Spindle Oil) or ISO-standard VG18.
2.  Manual oil supply

    | No.  | Where To Oil    |  Oiling Cycle | Ref. Figure
    |---:|---|---|---|
    | 1 | Take the bobbin case out of the hook. Feed small1amount of oil on the raceway. | 3-4 times a day | url_for_fig_1
    | 2 | Needle bar and needle bar shaft | Once a week | url_for_fig_2
    | 3 | Inside the arm | Once a week | url_for_fig_3, url_for_fig_4
    | 4 | Guide rail to the take-up lever | Once a week | url_for_fig_5

This is the ouput html after I run $ python3 -m markdown2 test2.md > exportToHTML/test2.html:

<h1>CLEANING</h1>

<p>| No.  | Important Parts for Cleaning    |  Cleaning Cycle | Ref. Figure
| ---:|---|---|---|
| 1 | Around the hook | Every day       | url<em>for</em>fig<em>1
| 2 | Guide rail to the take-up lever | Once a week | url</em>for<em>fig</em>2
| 3 | Around the movable blade and the fixed blade | Once in 3-7 days | url<em>for</em>fig_3
| 4 | X-Y drive pulley teeth and timing belt teeth | Once a month</p>

<h1>OIL SUPPLY</h1>

<ol>
<li>Oil supply   Use the SWF sewing machine oil (Spindle Oil) or ISO-standard VG18.</li>
<li><p>Manual oil supply</p>

<p>| No.  | Where To Oil    |  Oiling Cycle | Ref. Figure
|---:|---|---|---|
| 1 | Take the bobbin case out of the hook. Feed small1amount of oil on the raceway. | 3-4 times a day | url<em>for</em>fig<em>1
| 2 | Needle bar and needle bar shaft | Once a week | url</em>for<em>fig</em>2
| 3 | Inside the arm | Once a week | url<em>for</em>fig<em>3, url</em>for<em>fig</em>4
| 4 | Guide rail to the take-up lever | Once a week | url<em>for</em>fig_5</p></li>
</ol>

Output from $ mdv test2.md


CLEANING
  ───  ────────────────────────────────────────────  ────────────────  ─────────────
  No.  Important Parts for Cleaning                  Cleaning Cycle    Ref. Figure
  1    Around the hook                               Every day         url_for_fig_1
  2    Guide rail to the take-up lever               Once a week       url_for_fig_2
  3    Around the movable blade and the fixed blade  Once in 3-7 days  url_for_fig_3
  4    X-Y drive pulley teeth and timing belt teeth  Once a month
  ───  ────────────────────────────────────────────  ────────────────  ─────────────

OIL SUPPLY
    1. Oil supply   Use the SWF sewing machine oil (Spindle Oil) or ISO-standard VG18.
    2. Manual oil supply
      ───  ──────────────────────────────────────────────────────────────────────────────  ───────────────  ────────────────────────────
      No.  Where To Oil                                                                    Oiling Cycle     Ref. Figure
      1    Take the bobbin case out of the hook. Feed small1amount of oil on the raceway.  3-4 times a day  url_for_fig_1
      2    Needle bar and needle bar shaft                                                 Once a week      url_for_fig_2
      3    Inside the arm                                                                  Once a week      url_for_fig_3, url_for_fig_4
      4    Guide rail to the take-up lever                                                 Once a week      url_for_fig_5
      ───  ──────────────────────────────────────────────────────────────────────────────  ───────────────  ────────────────────────────
@dmenisdev
Copy link

I have the same issue

@WillianBR
Copy link

So do I!

@mkabadjov
Copy link

Try specifying "--extras tables" : $ python3 -m markdown2 --extras tables foo.md > foo.html

See extras.

@antoinepouille
Copy link

antoinepouille commented Apr 8, 2021

I have the same issue. I could circumvent it by removing the final | on the line with the ---, such as |---|---|---

Can the maintainers look into this? @trentm
In my opinion it's an important error, as quite misleading for a markdown that should be valid...

Example of failure: |cou | cou | \n |---|---| \n | c | c |

@arrol
Copy link

arrol commented Jun 3, 2021

same Issue here, seems to be a trailing whitespace, after the final | on the line with the ---, so there is a difference between |---|---|---| and |---|---|---|&nbsp;

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

No branches or pull requests

7 participants