# Some questions with highlighting words in rouge

**URL:** <https://talk.jekyllrb.com/t/some-questions-with-highlighting-words-in-rouge/6543>\
**Category:** Help\
**Created:** [October 7, 2021, 4:56am UTC](https://talk.jekyllrb.com/t/some-questions-with-highlighting-words-in-rouge/6543 "2021-10-07T04:56:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lewatoto](https://avatars.discourse-cdn.com/v4/letter/l/4bbf92/32.png) [@lewatoto](https://talk.jekyllrb.com/u/lewatoto)\
**Post date:** [October 7, 2021, 4:56am UTC](https://talk.jekyllrb.com/t/some-questions-with-highlighting-words-in-rouge/6543/1 "2021-10-07T04:56:28Z")

</div>

For example if i’ve use markdown for language highlight the text only lines don’t get included inside a tag for highlight.

for example:

```auto
{%- highlight md -%}
## title

here have some random text
{%- endhighlight -%}

```

render this:

```auto
<figure class="highlight">
<pre>
<code class="language-md" data-lang="md">
<span class="gu">## title</span>
here have some random text
</code>
</pre>
</figure>

```

Or if I used accented word with config language, rogue exclude this words

```auto
{%- highlight config -%}
tílde
no tilde
{%- endhighlight -%}

```

```auto
<figure class="highlight">
<pre>
<code class="language-config" data-lang="config">
<span class="n">t</span>
í
<span class="n">lde</span>
<span class="n">no</span>
 <span class="n">tilde</span>
</code>
</pre>
</figure>

```

is this normal behavior since the devs use english for most extra text on code blocks? my markdown and kramdown options on \_config.yml

```auto
markdown: kramdown

kramdown:
  syntax_highlighter: rouge
  syntax_highlighter_opts:
    span:
      line_numbers: false
    block:
      line_numbers: true

```

---

<div class="post-metadata">

**Author:** ![chuckhoupt](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/chuckhoupt/32/523_2.png) [@chuckhoupt](https://talk.jekyllrb.com/u/chuckhoupt)\
**Post date:** [October 7, 2021, 11:33am UTC](https://talk.jekyllrb.com/t/some-questions-with-highlighting-words-in-rouge/6543/2 "2021-10-07T11:33:55Z")

</div>

> [@lewatoto](#):
>
> For example if i’ve use markdown for language highlight the text only lines don’t get included inside a tag for highlight.

Yes, this is normal Kramdown highlighting for markup languages like Markdown, HTML, XML, etc. Plain text is left as plain text, with no styling span. If you need to style the plain text, you can use the `.language-*` classes.

> [@lewatoto](#):
>
> is [splitting accented words] normal behavior since the devs use english for most extra text on code blocks?

I’m not familiar with the Config language – maybe it is just an old file format? Possibly, Config only allows ASCII characters in keywords/identifiers, and so the highlighter splits tokens at accented characters?

Other languages/formats allow multilingual identifiers, and they work as expected. For example, Javascript:

```plaintext
{%- highlight js -%}
var tílde=2;
{%- endhighlight -%}

```

Renders as (rewrapped for clarity):

```html
<figure class="highlight">
<pre><code class="language-js" data-lang="js">
<span class="kd">var</span> 
<span class="nx">tílde</span>
<span class="o">=</span><span class="mi">2</span><span class="p">;</span>
</code></pre>
</figure>

```

---

<div class="post-metadata">

**Author:** ![lewatoto](https://avatars.discourse-cdn.com/v4/letter/l/4bbf92/32.png) [@lewatoto](https://talk.jekyllrb.com/u/lewatoto)\
**Post date:** [October 8, 2021, 1:37am UTC](https://talk.jekyllrb.com/t/some-questions-with-highlighting-words-in-rouge/6543/3 "2021-10-08T01:37:43Z")

</div>

Many thanks for the help.
