【问题标题】:Github-pages/kramdown won't render my mixed markdown/html correctlyGithub-pages/kramdown 不会正确呈现我的混合 markdown/html
【发布时间】:2020-03-11 22:05:31
【问题描述】:

我有一个混合的 HTML/Markdown 页面,我认为非常简单,但是 Github 页面提供了莫名其妙的渲染。

已配置为使用 kramdown/GFM。

这是吸引我的一段代码:

QuickFIX Settings
-----------------

* [Session](#session)
* [Validation](#validation)
* [Initiator](#initiator)
* [Acceptor](#acceptor)
* [Socket Configuration](#socketConfiguration)
* [Storage](#storage)
* [File Storage](#file)
* [Logging](#logging)
* [SSL](#ssl)
* [Sample Settings File](#sample)

<a name="session"/>

## Session

<table>
  <tr>
    <th>Setting</th>
    <th>Description</th>
    <th>Valid Values</th>
    <th>Default</th>
  </tr>

[more table code follows...]

当我在其他 Markdown 解析器(例如问题描述解析器)中预览 markdown 代码时,这很好。但是当我将它推送到gh-pages 分支时,我得到了这种垃圾:

为什么会有那些 tr-close 和 table-close 标签? (甚至还没有表格开始!)为什么表格实际上出现在 next 标题下?

这毫无意义!

这是一个开源项目,因此您可以在此处查看当前的实时渲染和源代码:

【问题讨论】:

  • 您的表中有一个不平衡(未闭合)的 td。名为 SendRedundantResendRequests 的元素的描述 td 永远不会关闭,从而破坏了整个表格
  • 老兄,将其发布为答案,以便我将其标记为已解决。

标签: github-pages kramdown


【解决方案1】:

您的表格损坏的原因是因为您的表格中有一个不平衡(未关闭)td,有效地破坏了 HTML 流程:

  <tr>
    <td class='setting'>SendRedundantResendRequests</td>
    <td class='description'>
<!-- ^-- this td element is never closed -->
      If set to Y, QuickFIX will send all necessary resend requests, even if they appear redundant.
      Some systems will not certify the engine unless it does this.
      When set to N, QuickFIX will attempt to minimize resend requests.
      This is particularly useful on high volume systems.
    <td class='valid'>
      <div>Y</div>
      <div>N</div>
    </td>
    <td class='default'>N</td>
  </tr>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-08-22
    • 1970-01-01
    • 1970-01-01
    • 2017-02-18
    • 2015-03-20
    • 2016-04-10
    • 1970-01-01
    相关资源
    最近更新 更多