Skip to content

The highlight ceases to exist when the input field is edited. #38

@arnonrdp

Description

@arnonrdp

The highlight ceases to exist when the input field is edited.
It also stops working when I change the language.

When this occurs, I receive the following message in the browser console:

Element previously highlighted. To highlight again, first unset `dataset.highlighted`.
<code class=​"hljs language-json" style=​"top:​ 0px;​ left:​ 0px;​ font-size:​ 13px;​ padding:​ 0px 20px 20px;​" data-highlighted=​"yes">​{ "Hello": "World" } ​</code>​
Gravacao.de.Tela.2023-10-10.as.13.01.45.mov

Here is the snippet of my code:

<CodeEditor
  :class="hljs"
  font-size="13px"
  :languages="[
    ['json', 'JSON'],
    ['yml', 'YAML']
  ]"
  v-model="value"
  width="100%"
  @lang="getLanguage"
/>
// <script setup> // Composition API
import hljs from 'highlight.js'
import CodeEditor from 'simple-code-editor'

Could anyone tell me if I'm missing something?
@justcaliturner, any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions