diff --git a/package-lock.json b/package-lock.json index c9647b2c3b..949c916196 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6102,6 +6102,12 @@ "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true }, + "prettier": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.4.1.tgz", + "integrity": "sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA==", + "dev": true + }, "pretty-hrtime": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", diff --git a/package.json b/package.json index 487ccd738b..1961040965 100755 --- a/package.json +++ b/package.json @@ -61,6 +61,7 @@ "mocha": "^6.2.0", "node-fetch": "^2.6.0", "npm-run-all": "^4.1.5", + "prettier": "^2.4.1", "pump": "^3.0.0", "refa": "^0.9.1", "regexp-ast-analysis": "^0.2.4", diff --git a/test-suite.html b/test-suite.html index 0dbd535016..c4ae782175 100644 --- a/test-suite.html +++ b/test-suite.html @@ -165,14 +165,21 @@
Sometimes, using the token stream tests is not powerful enough. By creating a test file with the file extension .js
instead of .test
, you can make Prism highlight arbitrary pieces of code and check their HTML results.
Sometimes, using the token stream tests is not powerful enough. By creating a test file with the file extension .html.test
instead of .test
, you can make Prism highlight arbitrary pieces of code and check their HTML results.
The language is determined by the folder containing the test file lies, as explained in the previous section.
The structure of your test file will look like this, for example:
-module.exports = {
- '➊': '<span class="token entity" title="➊">&#x278a;</span>',
- '¶': '<span class="token entity" title="¶">&#182;</span>',
-};
- The keys are the codes which will be highlighted by Prism. The values are the expected results, as HTML.
+&
+A
+
+----------------------------------------------------
+
+<span class="token entity named-entity" title="&">&amp;</span>
+<span class="token entity" title="A">&#x41;</span>
+
+----------------------------------------------------
+
+This is a comment explaining this test case.
+