theme-next / hexo-theme-next

Elegant and powerful theme for Hexo.
https://theme-next.org
Other
8.12k stars 2.05k forks source link

<tr> tag with class="header" displayed incorrectly #1725

Open ytf4425 opened 1 year ago

ytf4425 commented 1 year ago

Please follow this Issue template to provide relevant information, such as source code repositories, blog links, and screenshots, which will help us investigate. 请按照此 Issue 模版提供相关信息,例如源码仓库、博客链接和屏幕截图,这将有助于我们进行调查。

Issue Checklist


Expected behavior

The following normal table will be rendered to this html code by hexo-renderer-pandoc.

| A| B |
| :-: | :-: |
|A1| B1|
|A2| B2|

...

|A3| B3|
<div class="table-container"><table>
<colgroup>
<col style="width: 16%">
<col style="width: 83%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: center;">A</th>
<th style="text-align: center;">B</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: center;"> A1</td>
<td style="text-align: center;"> B1</td>
</tr>
<tr class="even">
<td style="text-align: center;">A2</td>
<td style="text-align: center;"> B2</td>
</tr>

......

<tr class="odd">
<td style="text-align: center;">AN</td>
<td style="text-align: center;">BN</td>
</tr>
</tbody>
</table></div>

And should be displayed like this.

图片

Actual behavior

图片

图片

Steps to reproduce the behavior

  1. use npm to uninstall hexo-renderer-marked and install hexo-renderer-pandoc.
  2. render a markdown table, then you will get the wrong display in your web page.
  3. remove the class="header" in tag like the following html code, then it seems to be ok.
<div class="table-container"><table>
<colgroup>
<col style="width: 16%">
<col style="width: 83%">
</colgroup>
<thead>
<tr>
<th style="text-align: center;">A</th>
<th style="text-align: center;">B</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: center;"> A1</td>
<td style="text-align: center;"> B1</td>
</tr>
<tr class="even">
<td style="text-align: center;">A2</td>
<td style="text-align: center;"> B2</td>
</tr>

......

<tr class="odd">
<td style="text-align: center;">AN</td>
<td style="text-align: center;">BN</td>
</tr>
</tbody>
</table></div>

Environment Information

Node.js and NPM Information

v16.15.1
8.11.0

Package dependencies Information

hexo-site@0.0.0 C:\path\to\dir
├── @next-theme/plugins@8.15.1
├── hexo-asset-img@1.0.0
├── hexo-deployer-git@4.0.0
├── hexo-generator-archive@2.0.0
├── hexo-generator-category@2.0.0
├── hexo-generator-index@3.0.0
├── hexo-generator-tag@2.0.0
├── hexo-next-valine@2.1.0
├── hexo-renderer-ejs@2.0.0
├── hexo-renderer-pandoc@0.3.1
├── hexo-renderer-stylus@2.1.0
├── hexo-server@3.0.0
├── hexo-theme-landscape@0.0.3
├── hexo-theme-next@8.15.1
└── hexo@7.0.0-rc1
welcome[bot] commented 1 year ago

Thanks for opening this issue, maintainers will get back to you as soon as possible!