Skip to content
This repository has been archived by the owner on Oct 7, 2022. It is now read-only.

Highlight.js assigns markdown and ruby classes for yaml files #109

Open
kaankabalak opened this issue Nov 30, 2018 · 0 comments
Open

Highlight.js assigns markdown and ruby classes for yaml files #109

kaankabalak opened this issue Nov 30, 2018 · 0 comments

Comments

@kaankabalak
Copy link
Collaborator

kaankabalak commented Nov 30, 2018

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:
screen shot 2018-11-30 at 3 27 54 pm

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:
screen shot 2018-11-30 at 3 23 49 pm

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.

@kaankabalak kaankabalak changed the title Highlight.js assigns markdown and ruby classes to yaml files Highlight.js assigns markdown and ruby classes for yaml files Dec 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant