Closed jerrywdlee closed 4 years ago
Describe the bug When use highlightjs-line-numbers.js , some comments cannot be detected on YAML. No <span class="hljs-comment"></span> for these comments
highlightjs-line-numbers.js
<span class="hljs-comment"></span>
To Reproduce
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.8/styles/xcode.min.css" integrity="sha256-fjO4CUN/XJTfsDmlIBojCwY4EV94jfOJpPzqd19TSko=" crossorigin="anonymous" /> <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.8/highlight.min.js" integrity="sha256-js+I1fdbke/DJrW2qXQlrw7VUEqmdeFeOW37UC0bEiU=" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/highlightjs-line-numbers.js/2.7.0/highlightjs-line-numbers.min.js" integrity="sha256-3f4oLge37B7QacI/ksfIIW3bPxh5xOli03/VKtvRWgU=" crossorigin="anonymous"></script> <style> td.hljs-ln-numbers { text-align: center; color: #ccc; border-right: 1px solid #AAA; vertical-align: top; padding-right: 5px; } td.hljs-ln-code { padding-left: 10px; } </style> <script> hljs.initHighlightingOnLoad(); hljs.initLineNumbersOnLoad(); </script> <pre><code class="yaml" ># 名前等 date: 令和1年6月7日現在 name_kana: りれき たろう name: 履歴 太郎 birth_day: 平成6年6月7日 (満 25 歳) gender: 男 cell_phone: 090-1234-5678 email: rireki-taro@example.org # 写真をアップロードした場合、このフィールドが無視されます photo: https://cdn.jsdelivr.net/gh/jerrywdlee/yaml_cv@master/photo.jpg # 住所 address_kana: とうきょうとちよだくちよだ address: 東京都千代田区千代田1-1-1 address_zip: 100-0001 tel: 03-000-000 # fax: 0120-111-XXX # 連絡先 # address_kana2: ほっかいどう わっかないし そうやみさき # address2: 北海道稚内市宗谷岬 # address_zip2: 098-6758 # tel2: 0120-222-XXX # fax2: 0120-333-XXX address2: 同上 # 学歴 education: - year: 平成21 month: 4 value: 履歴高校普通科 入学 - year: 平成24 month: 3 value: 同 卒業 - year: 平成24 month: 4 value: 履歴大学履歴書学部 入学 - year: 平成28 month: 3 value: 同 卒業 # 本人希望記入欄 request: | 貴社の規定に従います。</code></pre>
Expected behavior all # comments will have <span class="hljs-comment"></span>
# comments
Screenshots
with line number
without line number
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context Add any other context about the problem here.
@jerrywdlee thanks for report!
Please update hightlight.js to v10.0.3!
Describe the bug When use
highlightjs-line-numbers.js
, some comments cannot be detected on YAML. No<span class="hljs-comment"></span>
for these commentsTo Reproduce
Expected behavior all
# comments
will have<span class="hljs-comment"></span>
Screenshots
with line number
without line number
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context Add any other context about the problem here.