Skip to content

Copy error when using lineNos #2633

Description

@mysiki

Environment

  • Hugo hugo v0.161.1-ea8f66a7ce988664dcc84c052fc96757042e2e4a+extended linux/amd64 BuildDate=2026-04-29T13:56:01Z VendorInfo=gohugoio
  • Docsy last 0.15
  • How are you using Docsy? As a:
    • Hugo module
    • NPM module
    • Git submodule
    • Other:
  • OS:
    • Linux
    • macOS
    • Windows
    • Other:

Problem

When using code copy button with line number enable, the line number are copied.

Hugo conf (lineNos = true and lineNumbersInTable = false):

[markup]
  [markup.goldmark]
    [markup.goldmark.parser]
      wrapStandAloneImageWithinParagraph = false
      [markup.goldmark.parser.attribute]
        block = true
    [markup.goldmark.renderer]
      unsafe = true
  [markup.highlight]
    # See a complete list of available styles at https://xyproto.github.io/splash/docs/all.html
    noClasses  = false # Styles defined in assets/scss/td, so that we can have distinct styles for light and dark themes
    lineNos = true
    lineNumbersInTable = true

Take any code bloc like :

#Add your new file
git add -u
#Check
git status
#commit and Push
git commit -m "bla" && git push

Render as (in code bloc of course):

1 #Add your new file
2 git add -u
3 #Check
4 git status
5 #commit and Push
6 git commit -m "Update wrapper for cluster pen-euw1-z" && git push

When we used the "copy code" button, the line number are copied to.

The option lineNumbersInTable make the button disappear (in my case)

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions