rouge icon indicating copy to clipboard operation
rouge copied to clipboard

C++ lexer doesn't recognize the first function name

Open egor-tensin opened this issue 2 years ago • 0 comments

Name of the lexer cpp

Code sample

namespace {

void f1() {
}

void f2() {
}

void f3() {
}

}

rouge.jneen.net doesn't seem to work.

# bundle exec rougify version
4.1.2

The first function f1 doesn't get recognized as a function name here (f2 and f3 do).

# bundle exec rougify highlight -i test1.cpp --formatter-preset html
<span class="k">namespace</span> <span class="p">{</span>

<span class="kt">void</span> <span class="n">f1</span><span class="p">()</span> <span class="p">{</span>
<span class="p">}</span>

<span class="kt">void</span> <span class="nf">f2</span><span class="p">()</span> <span class="p">{</span>
<span class="p">}</span>

<span class="kt">void</span> <span class="nf">f3</span><span class="p">()</span> <span class="p">{</span>
<span class="p">}</span>

<span class="p">}</span>

Notice how f1 has the span class of n, while f2 & f3 have the correct class nf.

egor-tensin avatar Jun 07 '23 09:06 egor-tensin