Skip to content

Commit fe408d3

Browse files
committed
Use classes for templates in README and tests
1 parent d53c19b commit fe408d3

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ The next step is to set up a `template` to link `code-input` to your syntax-high
6464

6565
- *Highlight.js:*
6666
```js
67-
codeInput.registerTemplate("syntax-highlighted", codeInput.templates.hljs(hljs, [] /* Array of plugins (see below) */));
67+
codeInput.registerTemplate("syntax-highlighted", new codeInput.templates.Hljs(hljs, [] /* Array of plugins (see below) */));
6868
```
6969

7070
- *Prism.js:*
7171
```js
72-
codeInput.registerTemplate("syntax-highlighted", codeInput.templates.prism(Prism, [] /* Array of plugins (see below) */));
72+
codeInput.registerTemplate("syntax-highlighted", new codeInput.templates.Prism(Prism, [] /* Array of plugins (see below) */));
7373
```
7474

7575
- *Custom:*
@@ -106,7 +106,7 @@ The next step is to set up a `template` to link `code-input` to your syntax-high
106106
<!--...-->
107107
<script>
108108
codeInput.registerTemplate("syntax-highlighted",
109-
codeInput.templates.hljs(
109+
new codeInput.templates.Hljs(
110110
hljs,
111111
[
112112
new codeInput.plugins.Autodetect(),

tests/tester.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ function waitAsync(milliseconds) {
108108
function beginTest(isHLJS) {
109109
let codeInputElem = document.querySelector("code-input");
110110
if(isHLJS) {
111-
codeInput.registerTemplate("code-editor", codeInput.templates.hljs(hljs, [
111+
codeInput.registerTemplate("code-editor", new codeInput.templates.Hljs(hljs, [
112112
new codeInput.plugins.AutoCloseBrackets(),
113113
new codeInput.plugins.Autocomplete(function(popupElem, textarea, selectionEnd) {
114114
if(textarea.value.substring(selectionEnd-5, selectionEnd) == "popup") {
@@ -127,7 +127,7 @@ function beginTest(isHLJS) {
127127
new codeInput.plugins.SpecialChars(true),
128128
]));
129129
} else {
130-
codeInput.registerTemplate("code-editor", codeInput.templates.prism(Prism, [
130+
codeInput.registerTemplate("code-editor", new codeInput.templates.Prism(Prism, [
131131
new codeInput.plugins.AutoCloseBrackets(),
132132
new codeInput.plugins.Autocomplete(function(popupElem, textarea, selectionEnd) {
133133
if(textarea.value.substring(selectionEnd-5, selectionEnd) == "popup") {
@@ -590,4 +590,4 @@ console.log("I've got another line!", 2 &lt; 3, "should be true.");
590590
document.querySelector("h2").style.backgroundColor = "lightgreen";
591591
document.querySelector("h2").textContent = "All Tests have Passed.";
592592
}
593-
}
593+
}

0 commit comments

Comments
 (0)