mirror of
https://github.com/gohugoio/hugo.git
synced 2024-05-11 05:54:58 +00:00
Insert code tag for server-side syntax highlighting
Inserts a code tag into Pygments output with the language-info that is present when using client-side highlighting (useful for CSS hooks) ```html <code class="language-go" data-lang="go"> ``` closes #1490
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
6a3aced15a
commit
ec9c691216
@@ -38,7 +38,7 @@ func TestCodeFence(t *testing.T) {
|
||||
input, expected string
|
||||
}
|
||||
data := []test{
|
||||
{true, "<html></html>", "<div class=\"highlight\"><pre><span class=\"nt\"><html></html></span>\n</pre></div>\n"},
|
||||
{true, "<html></html>", "<div class=\"highlight\"><pre><code class=\"language-html\" data-lang=\"html\"><span class=\"nt\"><html></html></span>\n</code></pre></div>\n"},
|
||||
{false, "<html></html>", "<pre><code class=\"language-html\"><html></html></code></pre>\n"},
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user