0

我正在尝试使用 pypandoc 将 HTML 转换为 md markdown(与 Hugo 一起使用)。以下准系统表:

<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>

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

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

| 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 代码,只是全部粘在一起:

+—————–+—————–+—————–+—————–+ | 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. | +—————–+—————–+—————–+—————–+
4

1 回答 1

0

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

于 2021-08-03T16:39:02.843 回答