Skip to content

Commit

Permalink
Small adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
valeriangalliat committed Mar 5, 2020
1 parent 603503e commit 5fafb06
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -21,7 +21,7 @@ Name | Type | Description
-----------|------|----------------------------------------------------------------------------|--------
`auto` | boolean | Whether to automatically detect language if not specified. | `true`
`code` | boolean | Whether to add the `hljs` class to raw code blocks (not fenced blocks). | `true`
`register` | object | Register other languages which are not included in the standard pack. | null
`register` | object | Register other languages which are not included in the standard pack. | `null`

### Register languages

Expand Down
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -8,7 +8,7 @@ const maybe = f => {
}
}

// allow registration of other languages
// Allow registration of other languages.
const registerLangs = (register) => register &&
Object.entries(register).map(([lang, pack]) => { hljs.registerLanguage(lang, pack) })

Expand Down
6 changes: 3 additions & 3 deletions test.js
Expand Up @@ -41,6 +41,6 @@ equal(
equal(
md().use(highlightjs, { register: { test: require('highlight.js/lib/languages/sql') } })
.render('```test\nSELECT * FROM TABLE;\n```'),
'<pre><code class="hljs language-test"><span class="hljs-keyword">SELECT</span> * <span class="hljs-keyword">FROM</span> <span class="hljs-keyword">TABLE</span>;\n' +
'</code></pre>\n'
)
`<pre><code class="hljs language-test"><span class="hljs-keyword">SELECT</span> * <span class="hljs-keyword">FROM</span> <span class="hljs-keyword">TABLE</span>;
</code></pre>
`)

0 comments on commit 5fafb06

Please sign in to comment.