Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Tables not rendering in HTML

未关闭
#346 5 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
38/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
python
领域
tooling

调研方向

使用 python3 -m markdown2 test2.md 重现 test2.md 中的报告,并将其 HTML 与 issue 中显示的 mdv 渲染结果进行比较。跟踪 parser 对两个表格示例的处理行为,包括缩进表格,并验证生成的 HTML 是否符合预期的表格结构,同时不影响周围的标题和列表。

由索引模型根据 Issue 内容生成。

描述

Bug

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
      ───  ──────────────────────────────────────────────────────────────────────────────  ───────────────  ────────────────────────────
主要语言
Python
星标
2.8k
派生
459
平均合并
2 天 19 小时
30 天内合并 PR
4

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

trentm/python-markdown2 的其他 Issue

查看 trentm/python-markdown2 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。