gluegun
gluegun copied to clipboard
Highlight.js assigns markdown and ruby classes for yaml files
The auto detection feature of Highlight.js incorrectly highlights certain blocks of code, ideally we should have a way to pick up the argument from the lang
attribute of the pre
class and highlight accordingly if possible.
The following output is highlighted as a Makefile:
```yaml
apiVersion: v1
kind: Pod
metadata:
name: prom-example
labels:
app: prom-example
spec:
containers:
- image: minio/minio
name: minio
args:
- server
- /tmp/minio
```
Here is the Gluegun output:
And the following is highlighted as a Ruby file:
```yaml
apiVersion: v1
kind: Pod
metadata:
name: prom-example
labels:
app: prom-example
annotations:
prometheus.io/scrape: 'true' # turn on scraping first
prometheus.io/path: '/minio/prometheus/metrics' # the URL path of the endpoint that provides metrics
prometheus.io/scheme: 'http' # protocol scheme of the endpoint
prometheus.io/port: '9000' # port of the endpoint
spec:
containers:
- image: minio/minio
name: minio
args:
- server
- /tmp/minio
```
Here is the Gluegun output:
Notice that both code blocks have the code <pre>
tag with attribute lang="yaml
and it should also be noted that the hljs classes are being created on the client side.