Repository: gohugoio/hugo (language: go)

Issue:
Do not render hl_style as an HTML attribute
The [yuin/goldmark-highlighting](https://github.com/yuin/goldmark-highlighting) module accepts the following attributes: `linenos`, `linenostart`, `hl_lines`, and `hl_style`.

For example:

`````
```bash {linenos=table linenostart=4 hl_lines=["4-6",9] hl_style=emacs}
#!/usr/bin/env bash

mul() {
  foo=$1
  bar=$2
  echo $((foo * bar))
}

mul 6 7
```
`````

These attributes have special meaning, and should not be rendered as HTML attributes in the wrapping element.

We already do this for `linenos`, `linenostart`, and `hl_lines`. We just need to add `hl_style` to the list.


Discussion / hints:

Fix patch:
diff --git a/markup/goldmark/render_hooks.go b/markup/goldmark/render_hooks.go
index 0e942e6f57a..9e9ca197678 100644
--- a/markup/goldmark/render_hooks.go
+++ b/markup/goldmark/render_hooks.go
@@ -148,8 +148,9 @@ var (
 
 	// Attributes with special meaning that does not make sense to render in HTML.
 	attributeExcludes = map[string]bool{
-		"linenos":     true,
 		"hl_lines":    true,
+		"hl_style":    true,
+		"linenos":     true,
 		"linenostart": true,
 	}
 )


Test patch: