首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >pypandoc html到md表

pypandoc html到md表
EN

Stack Overflow用户
提问于 2021-08-03 16:18:23
回答 1查看 32关注 0票数 0

我正在尝试使用pypandoc将HTML转换为md markdown (用于Hugo)。以下是基本表格:

代码语言:javascript
复制
<table >
                     <tbody>
                        <tr >
                            <td >Case&#160;ID</td>
                            <td >Internal&#160;ID</td>
                            <td >CVE&#160;ID</td>
                            <td >Description</td>
                        </tr>
                        <tr >
                            <td >01144864<br />01153461<br />01140233<br />01145760<br />01147797</td>
                            <td >RDST-30212 RDST-30213<br /></td>
                            <td >CVE-2019-17569 <br />CVE-2020-1935<br />CVE-2019-17569</td>
                            <td >Apache Tomcat vulnerabilities are fixed with the upgrade of the Apache Tomcat library to 7.0.103.</td>
                        </tr>
                        <tr >
                            <td >01055204</td>
                            <td >RDST-19886</td>
                            <td >CWE-757</td>
                            <td >
                                <p><strong>Issue:</strong> Previously, TLS Fallback Signaling Cipher Suite Value (SCSV) was not supported and this posed a risk of client-side or server-side protocol downgrade.<br /></p>
                                <p><strong>Resolution:</strong> Now, with the update to Java 11, this issue is fixed.</p>
                            </td>
                        </tr>
                        </tbody>
                        </table>

pypandoc在markdown中的输出如下所示。经Hugo服务器处理后,不会转换为表:

代码语言:javascript
复制
 +-----------------+-----------------+-----------------+-----------------+

| Case ID         | Internal ID     | CVE ID          | Description     |

+-----------------+-----------------+-----------------+-----------------+

| 01144864\       | RDST-30212      | CVE-2019-17569\ | Apache Tomcat   |

| 01153461\       | RDST-30213\     | CVE-2020-1935\  | vulnerabilities |

| 01140233\       |                 | CVE-2019-17569  | are fixed with  |

| 01145760\       |                 |                 | the upgrade of  |

| 01147797        |                 |                 | the Apache      |

|                 |                 |                 | Tomcat library  |

|                 |                 |                 | to 7.0.103.     |

+-----------------+-----------------+-----------------+-----------------+

输出看起来和md代码一样,只是都粘在一起了:

代码语言:javascript
复制
+—————–+—————–+—————–+—————–+ | Case ID | Internal ID | CVE ID | Description | +—————–+—————–+—————–+—————–+ | 01144864\ | RDST-30212 | CVE-2019-17569\ | Apache Tomcat | | 01153461\ | RDST-30213\ | CVE-2020-1935\ | vulnerabilities | | 01140233\ | | CVE-2019-17569 | are fixed with | | 01145760\ | | | the upgrade of | | 01147797 | | | the Apache | | | | | Tomcat library | | | | | to 7.0.103. | +—————–+—————–+—————–+—————–+ | 01055204 | RDST-19886 | CWE-757 | Issue: | | | | | Previously, TLS | | | | | Fallback | | | | | Signaling | | | | | Cipher Suite | | | | | Value" (SCSV) | | | | | was not | | | | | supported and | | | | | this posed a | | | | | risk of | | | | | client-side or | | | | | server-side | | | | | protocol | | | | | downgrade.\ | | | | | | | | | | Resolution: | | | | | Now, with the | | | | | update to Java | | | | | 11, this issue | | | | | is fixed. | +—————–+—————–+—————–+—————–+
EN

回答 1

Stack Overflow用户

发布于 2021-08-03 16:39:03

我现在已经看到(在https://daringfireball.net/projects/markdown/syntax#html中)可以在.md文件中使用html,我想我会坚持使用它。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68639565

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档