diff --git a/README.md b/README.md index 87491da..2607e46 100644 --- a/README.md +++ b/README.md @@ -54,8 +54,8 @@ From JSDelivr CDN (click) ```html - - + + ``` @@ -64,12 +64,12 @@ The next step is to set up a `template` to link `code-input` to your syntax-high - *Highlight.js:* ```js - codeInput.registerTemplate("syntax-highlighted", codeInput.templates.hljs(hljs, [] /* Array of plugins (see below) */)); + codeInput.registerTemplate("syntax-highlighted", new codeInput.templates.Hljs(hljs, [] /* Array of plugins (see below) */)); ``` - *Prism.js:* ```js - codeInput.registerTemplate("syntax-highlighted", codeInput.templates.prism(Prism, [] /* Array of plugins (see below) */)); + codeInput.registerTemplate("syntax-highlighted", new codeInput.templates.Prism(Prism, [] /* Array of plugins (see below) */)); ``` - *Custom:* @@ -106,7 +106,7 @@ The next step is to set up a `template` to link `code-input` to your syntax-high + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/prism.html b/tests/prism.html index 0a8ae01..50fb510 100644 --- a/tests/prism.html +++ b/tests/prism.html @@ -51,4 +51,4 @@

Test for highlight.js

beginTest(false); - \ No newline at end of file + diff --git a/tests/tester.js b/tests/tester.js index 5b0899e..5aca24c 100644 --- a/tests/tester.js +++ b/tests/tester.js @@ -108,7 +108,7 @@ function waitAsync(milliseconds) { function beginTest(isHLJS) { let codeInputElem = document.querySelector("code-input"); if(isHLJS) { - codeInput.registerTemplate("code-editor", codeInput.templates.hljs(hljs, [ + codeInput.registerTemplate("code-editor", new codeInput.templates.Hljs(hljs, [ new codeInput.plugins.AutoCloseBrackets(), new codeInput.plugins.Autocomplete(function(popupElem, textarea, selectionEnd) { if(textarea.value.substring(selectionEnd-5, selectionEnd) == "popup") { @@ -127,7 +127,7 @@ function beginTest(isHLJS) { new codeInput.plugins.SpecialChars(true), ])); } else { - codeInput.registerTemplate("code-editor", codeInput.templates.prism(Prism, [ + codeInput.registerTemplate("code-editor", new codeInput.templates.Prism(Prism, [ new codeInput.plugins.AutoCloseBrackets(), new codeInput.plugins.Autocomplete(function(popupElem, textarea, selectionEnd) { if(textarea.value.substring(selectionEnd-5, selectionEnd) == "popup") { @@ -590,4 +590,4 @@ console.log("I've got another line!", 2 < 3, "should be true."); document.querySelector("h2").style.backgroundColor = "lightgreen"; document.querySelector("h2").textContent = "All Tests have Passed."; } -} \ No newline at end of file +}