GeekaholicLin / hexo-theme-ylion

:blush: 说不定是一个让你感到惊喜的hexo主题 :beers: :candy:
http://blog.geekaholic.cn
MIT License
120 stars 30 forks source link

<details> <summary> 語法無法正確 render #34

Open mosdeo opened 7 years ago

mosdeo commented 7 years ago

不知道這是 pandoc 還是主題的問題?

Makrdown 原文,Github 上可以正確顯示

Blog 文章就不能正確顯示這個語法了

GeekaholicLin commented 7 years ago

这是pandoc的渲染问题,官方issue有遇到这种问题,但大致的解决办法可以使用div包裹着你的详情内容,比方说:

<details>
 <summary>「打造人工智慧團隊」筆記(2017.09.02)</summary>
<div>

### 科學定義

- 系統性
- 一般化
- 可驗證

</div>

</details>

可以点击查看效果,注意:div中的markdown语法请遵循pandoc的语法,比如标题下要空行等

GeekaholicLin commented 7 years ago

额,疏忽了,其实也没有完全正确地被渲染。

<details> <summary>「打造人工智慧團隊」筆記(2017.09.02)</summary>
<div>
<h3 id="科學定義">科學定義</h3>
<ul>
<li>系統性</li>
<li>一般化</li>
<li>可驗證</li>
</ul>
</div>
-  <p></details></p>
+ </details>

最后的<p></details></p>其实是非法的,加号才是准确的,但是我在浏览器中测试确实是可以通过的,你可以修改markdown文件后试试。

PS:你这个issue还牵扯出了github的bug,神奇... 你可以尝试在notification页面点击标题看看,是无法跳转进入的。。

mosdeo commented 7 years ago

非法?不懂耶,Try pandoc 轉出來,不論是 pandoc md 或者 Github md 都會轉出<p></details></p> 不是嗎?

mosdeo commented 7 years ago

而且我在 notification 頁面點擊沒有發現異常(被點擊頁面如圖) 2017-09-12 17-59-05

GeekaholicLin commented 7 years ago

image

你标题中的标签被当成HTML了。可能是浏览器差异?应该不会吧,我的也是chrome啊。

回到异常的问题,Github转义成什么样我不知道,但<p></details></p>是非法的,正确的应该只有</detail>,否则的话就<detail>标签无法正确闭合,但是HTML5的容错以及浏览器的处理,应该会正确渲染。

mosdeo commented 7 years ago

@GeekaholicLin 你那個畫面真的是太神奇了 XD 因為我看起來都正常,獎金只好給你賺了 GitHub Security Bug Bounty

GeekaholicLin commented 7 years ago

哇,第一次听说。 暂时没确认是不是官方的bug。后来想想,倒觉得可能是插件问题

GeekaholicLin commented 7 years ago

找到"罪魁祸首"了,插件Github HoverCard的问题

GeekaholicLin commented 7 years ago

好像你的渲染问题还没有解决?

mosdeo commented 7 years ago

加上

只是可以展開收起,包住的內容還是無法正確渲染 2017-09-15 14-11-00

GeekaholicLin commented 7 years ago

因为你div里面的格式是不正确的pandoc语法,##应该顶格写

image image