]> git.maquefel.me Git - brevno-suite/hugo/commit
Fix indentation in highlight shortcode
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Mon, 30 May 2022 18:42:46 +0000 (20:42 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 31 May 2022 07:05:54 +0000 (09:05 +0200)
commit6f7bf3f2d7eda178d0dba4a6bf3dfa50229df7ae
tree781580c54bed6942f1844def43750b027d8bbc76
parent9e904d756be02ca30e4cd9abb1eae8ba01f9c8af
Fix indentation in highlight shortcode

This commit adds a new `.InnerDeindent` method to the shortcode context, which is `.Inner` with any
indendation removed. This is then used in the built-in `highlight` shortcode to prevent the extra
whitespace getting hightlighted.

Fixes #4717
docs/content/en/variables/shortcodes.md
hugolib/shortcode.go
hugolib/shortcode_test.go
tpl/tplimpl/embedded/templates/shortcodes/highlight.html
tpl/tplimpl/template_ast_transformers.go