Anchor Line Numbers

anchorlinenos=true attribute doesn’t work when using code fences.

Works when using highlight shortcode

Below, we can see the line numbers in the Hugo-rendered code block are hyperlinked.

In line 1 we remember the current position. Line 2 jumps to point-min.

1
2
(save-excursion
   (goto-char (point-min))

Doesn’t work when using code fences

But below, with the exact same code block and attributes (with changed anchor prefix), but with using code fences instead of highlight shortcode, the line numbers are no longer hyperlinked.

In line 1 we remember the current position. Line 2 jumps to point-min.

1
2
(save-excursion
   (goto-char (point-min))

References

To reproduce this page/issue

git clone https://gitlab.com/hugo-mwe/hugo-mwe
cd hugo-mwe
git checkout anchorlinenos
./srv.sh
            
Markdown source of this page | Built with Hugo 0.92.0

Go Up | Back to Home | Source code repo