Docs: Minor improvement (#2513)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273
diff --git a/components/prism-core.js b/components/prism-core.js
index 2be3562..9f82910 100644
--- a/components/prism-core.js
+++ b/components/prism-core.js
@@ -455,7 +455,8 @@ var _ = {
*
* The following hooks will be run:
* 1. `before-highlightall`
- * 2. All hooks of {@link Prism.highlightElement} for each element.
+ * 2. `before-all-elements-highlight`
+ * 3. All hooks of {@link Prism.highlightElement} for each element.
*
* @param {ParentNode} container The root element, whose descendants that have a `.language-xxxx` class will be highlighted.
* @param {boolean} [async=false] Whether each element is to be highlighted asynchronously using Web Workers.
@@ -487,11 +488,14 @@ var _ = {
* The following hooks will be run:
* 1. `before-sanity-check`
* 2. `before-highlight`
- * 3. All hooks of {@link Prism.highlight}. These hooks will only be run by the current worker if `async` is `true`.
+ * 3. All hooks of {@link Prism.highlight}. These hooks will be run by an asynchronous worker if `async` is `true`.
* 4. `before-insert`
* 5. `after-highlight`
* 6. `complete`
*
+ * Some the above hooks will be skipped if the element doesn't contain any text or there is no grammar loaded for
+ * the element's language.
+ *
* @param {Element} element The element containing the code.
* It must have a class of `language-xxxx` to be processed, where `xxxx` is a valid language identifier.
* @param {boolean} [async=false] Whether the element is to be highlighted asynchronously using Web Workers
diff --git a/docs/Prism.hooks.html b/docs/Prism.hooks.html
index a3528fe..28f00aa 100644
--- a/docs/Prism.hooks.html
+++ b/docs/Prism.hooks.html
@@ -73,7 +73,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line656">line 656</a>
+ <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line660">line 660</a>
</li></ul></dd>
@@ -152,7 +152,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line671">line 671</a>
+ <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line675">line 675</a>
</li></ul></dd>
@@ -314,7 +314,7 @@ Hooks are usually directly run by a highlight function but you can also run hook
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line688">line 688</a>
+ <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line692">line 692</a>
</li></ul></dd>
diff --git a/docs/Prism.html b/docs/Prism.html
index 0744baa..c1a9a50 100644
--- a/docs/Prism.html
+++ b/docs/Prism.html
@@ -263,7 +263,7 @@ Prism.manual = true;
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line597">line 597</a>
+ <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line601">line 601</a>
</li></ul></dd>
@@ -676,7 +676,7 @@ each one of them.</p>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line466">line 466</a>
+ <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line467">line 467</a>
</li></ul></dd>
@@ -721,6 +721,7 @@ each one of them.</p>
<p>The following hooks will be run:</p>
<ol>
<li><code>before-highlightall</code></li>
+<li><code>before-all-elements-highlight</code></li>
<li>All hooks of <a href="Prism.html#.highlightElement"><code>Prism.highlightElement</code></a> for each element.</li>
</ol>
</div>
@@ -910,7 +911,7 @@ each one of them.</p>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line509">line 509</a>
+ <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line513">line 513</a>
</li></ul></dd>
@@ -955,11 +956,13 @@ each one of them.</p>
<ol>
<li><code>before-sanity-check</code></li>
<li><code>before-highlight</code></li>
-<li>All hooks of <a href="Prism.html#.highlight"><code>Prism.highlight</code></a>. These hooks will only be run by the current worker if <code>async</code> is <code>true</code>.</li>
+<li>All hooks of <a href="Prism.html#.highlight"><code>Prism.highlight</code></a>. These hooks will be run by an asynchronous worker if <code>async</code> is <code>true</code>.</li>
<li><code>before-insert</code></li>
<li><code>after-highlight</code></li>
<li><code>complete</code></li>
</ol>
+<p>Some the above hooks will be skipped if the element doesn't contain any text or there is no grammar loaded for
+the element's language.</p>
</div>
@@ -1154,7 +1157,7 @@ Mostly useful when <code>async</code> is <code>true</code>, since in that case,
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line633">line 633</a>
+ <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line637">line 637</a>
</li></ul></dd>
diff --git a/docs/Token.html b/docs/Token.html
index 4443776..44e767d 100644
--- a/docs/Token.html
+++ b/docs/Token.html
@@ -80,7 +80,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line722">line 722</a>
+ <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line726">line 726</a>
</li></ul></dd>
@@ -364,7 +364,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line749">line 749</a>
+ <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line753">line 753</a>
</li></ul></dd>
@@ -447,7 +447,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line741">line 741</a>
+ <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line745">line 745</a>
</li></ul></dd>
@@ -524,7 +524,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line732">line 732</a>
+ <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line736">line 736</a>
</li></ul></dd>
diff --git a/docs/global.html b/docs/global.html
index 478976c..3801628 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -143,7 +143,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line1157">line 1157</a>
+ <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line1161">line 1161</a>
</li></ul></dd>
@@ -274,7 +274,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line1136">line 1136</a>
+ <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line1140">line 1140</a>
</li></ul></dd>
@@ -559,7 +559,7 @@ each another.</p></td>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line1165">line 1165</a>
+ <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line1169">line 1169</a>
</li></ul></dd>
@@ -713,7 +713,7 @@ each another.</p></td>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line1175">line 1175</a>
+ <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line1179">line 1179</a>
</li></ul></dd>
@@ -859,7 +859,7 @@ each another.</p></td>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line754">line 754</a>
+ <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line758">line 758</a>
</li></ul></dd>
diff --git a/docs/prism-core.js.html b/docs/prism-core.js.html
index 644beff..fed9633 100644
--- a/docs/prism-core.js.html
+++ b/docs/prism-core.js.html
@@ -508,7 +508,8 @@ var _ = {
*
* The following hooks will be run:
* 1. `before-highlightall`
- * 2. All hooks of {@link Prism.highlightElement} for each element.
+ * 2. `before-all-elements-highlight`
+ * 3. All hooks of {@link Prism.highlightElement} for each element.
*
* @param {ParentNode} container The root element, whose descendants that have a `.language-xxxx` class will be highlighted.
* @param {boolean} [async=false] Whether each element is to be highlighted asynchronously using Web Workers.
@@ -540,11 +541,14 @@ var _ = {
* The following hooks will be run:
* 1. `before-sanity-check`
* 2. `before-highlight`
- * 3. All hooks of {@link Prism.highlight}. These hooks will only be run by the current worker if `async` is `true`.
+ * 3. All hooks of {@link Prism.highlight}. These hooks will be run by an asynchronous worker if `async` is `true`.
* 4. `before-insert`
* 5. `after-highlight`
* 6. `complete`
*
+ * Some the above hooks will be skipped if the element doesn't contain any text or there is no grammar loaded for
+ * the element's language.
+ *
* @param {Element} element The element containing the code.
* It must have a class of `language-xxxx` to be processed, where `xxxx` is a valid language identifier.
* @param {boolean} [async=false] Whether the element is to be highlighted asynchronously using Web Workers
diff --git a/prism.js b/prism.js
index 4eebe7d..c4e6e24 100644
--- a/prism.js
+++ b/prism.js
@@ -460,7 +460,8 @@ var _ = {
*
* The following hooks will be run:
* 1. `before-highlightall`
- * 2. All hooks of {@link Prism.highlightElement} for each element.
+ * 2. `before-all-elements-highlight`
+ * 3. All hooks of {@link Prism.highlightElement} for each element.
*
* @param {ParentNode} container The root element, whose descendants that have a `.language-xxxx` class will be highlighted.
* @param {boolean} [async=false] Whether each element is to be highlighted asynchronously using Web Workers.
@@ -492,11 +493,14 @@ var _ = {
* The following hooks will be run:
* 1. `before-sanity-check`
* 2. `before-highlight`
- * 3. All hooks of {@link Prism.highlight}. These hooks will only be run by the current worker if `async` is `true`.
+ * 3. All hooks of {@link Prism.highlight}. These hooks will be run by an asynchronous worker if `async` is `true`.
* 4. `before-insert`
* 5. `after-highlight`
* 6. `complete`
*
+ * Some the above hooks will be skipped if the element doesn't contain any text or there is no grammar loaded for
+ * the element's language.
+ *
* @param {Element} element The element containing the code.
* It must have a class of `language-xxxx` to be processed, where `xxxx` is a valid language identifier.
* @param {boolean} [async=false] Whether the element is to be highlighted asynchronously using Web Workers