Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

highlight-line-numbers causing commented code on uncommented code #82

Open
@azamuddin

Description

@azamuddin

Describe the bug
highlight-line-numbers causing commented code on uncommented code

To Reproduce
Steps to reproduce the behavior:

  1. I'm developing nextjs app
  2. importinghighlight.js lazy loading using NodeJSimport()
  3. importinghighlightjs-line-numbers.js lazy loading using NodeJS
  4. callinghljs.highlightBlock thenhljs.lineNumbersBlock
  5. first render is no problem
  6. if the component did re-render, which also calls againhljs.highlightBlock andhljs.lineNumbersBlock it broke the highlighting

** Problem **

  • code that is not a commented recognized as comment
  • happens on any codelanguage

Expected behavior
highlight-line-numbers should not modify highlighting done byhighlight.js for the subsequent calls

Screenshots
Screen Shot 2021-02-19 at 08 36 20

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: Chrome
  • Version: 88.0.4324.150 (Official Build) (x86_64)

Additional context
I know I can prevent re-calling themethod by tracking if it has been called or not. But I also have cases when this is not possible.

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp