highlightjs/highlight.js

(cpp) Keywords followed by parens are treated as `built_in`

開放

#3,980 建立於 2024年1月31日

 (13 則留言) (0 個反應) (0 位負責人)JavaScript (3,497 個分叉)batch import
buggood first issuehelp welcomelanguage

倉庫指標

星標
 (22,960 顆星)
PR 合併指標
 (平均合併 6分鐘) (30 天內合併 2 個 PR)

描述

Describe the issue Keywords, such as static_assert, sizeof, etc. are typically followed by parentheses. static_assert; will be highlighted as if it's a keyword, but static_assert(true); is highlighted as a built_in.

image

Which language seems to have the issue?

<code class="hljs cpp">
<code class="hljs c++">

Are you using highlight or highlightAuto?

highlight, I think?

Sample Code to Reproduce

In reveal.js, with a freshly-downloaded hljs, add the following:

<pre><code class="hljs c++" data-trim data-noescape data-line-numbers style="overflow: visible;">
  static_assert; // highlighted as keyword
  static_assert(true); // highlighted as built_in
</code></pre>

Expected behavior

Keywords continue to use their keyword colour when followed by parens.

貢獻者指南