mirror of
https://github.com/codex-team/codex.docs.git
synced 2025-08-08 06:55:26 +02:00
lint code
This commit is contained in:
parent
cb30eef9bd
commit
223483cf59
1 changed files with 3 additions and 2 deletions
|
@ -15,7 +15,7 @@ export default class CodeStyler {
|
|||
* @param {string} selector - CSS selector for code blocks
|
||||
* @param {string[]} languages - list of languages to highlight, see hljs.listLanguages()
|
||||
*/
|
||||
constructor({selector, languages = ['javascript', 'xml', 'json', 'css']}) {
|
||||
constructor({ selector, languages = ['javascript', 'xml', 'json', 'css'] }) {
|
||||
this.codeBlocksSelector = selector;
|
||||
this.languages = languages;
|
||||
this.langsAvailable = {
|
||||
|
@ -50,6 +50,7 @@ export default class CodeStyler {
|
|||
hljs.highlightBlock(block);
|
||||
|
||||
block.innerHTML = block.innerHTML.replace(/\n([+].*)/ig, '\n<span class="diff diff-plus">$1</span>');
|
||||
block.innerHTML = block.innerHTML.replace(/\n([-].*)/ig, '\n<span class="diff diff-minus">$1</span>'); });
|
||||
block.innerHTML = block.innerHTML.replace(/\n([-].*)/ig, '\n<span class="diff diff-minus">$1</span>');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue