diff options
author | Bjørn Erik Pedersen <[email protected]> | 2022-12-30 09:20:58 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2023-01-04 18:01:26 +0100 |
commit | e402d91ee199afcace8ae75da6c3587bb8089ace (patch) | |
tree | a0f51de9707ed03aa1a3d7a9195fd9d0fceab108 /markup/highlight/highlight.go | |
parent | 3c51625c7152abca7e035fae15fc6807ca21cc86 (diff) | |
download | hugo-e402d91ee199afcace8ae75da6c3587bb8089ace.tar.gz hugo-e402d91ee199afcace8ae75da6c3587bb8089ace.zip |
Misc doc, code refactoring to improve documentation
Diffstat (limited to 'markup/highlight/highlight.go')
-rw-r--r-- | markup/highlight/highlight.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/markup/highlight/highlight.go b/markup/highlight/highlight.go index 010c941f7..b74997700 100644 --- a/markup/highlight/highlight.go +++ b/markup/highlight/highlight.go @@ -157,10 +157,12 @@ type HightlightResult struct { highlighted template.HTML } +// Wrapped returns the highlighted code wrapped in a <div>, <pre> and <code> tag. func (h HightlightResult) Wrapped() template.HTML { return h.highlighted } +// Inner returns the highlighted code without the wrapping <div>, <pre> and <code> tag, suitable for inline use. func (h HightlightResult) Inner() template.HTML { return h.highlighted[h.innerLow:h.innerHigh] } |