mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-07 04:08:43 +00:00
Add 'trust' setting to demo (#2107)
Ask if enabling 'trust' from the permalink
This commit is contained in:
@@ -162,6 +162,10 @@
|
|||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><label for="trust">trust</label></td>
|
||||||
|
<td><input type="checkbox" id="trust"/></td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<h4><label for="macros">macros</label></h4>
|
<h4><label for="macros">macros</label></h4>
|
||||||
<textarea id="macros" placeholder="JSON">
|
<textarea id="macros" placeholder="JSON">
|
||||||
|
@@ -48,10 +48,12 @@ window.WebFontConfig = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var katexOptions = ["displayMode", "leqno", "fleqn", "throwOnError",
|
var katexOptions = ["displayMode", "leqno", "fleqn", "throwOnError",
|
||||||
"errorColor", "strict", "macros"].map(function(id) {
|
"errorColor", "strict", "trust", "macros"].map(function(id) {
|
||||||
var el = document.getElementById(id);
|
var el = document.getElementById(id);
|
||||||
if (el.type === "checkbox") {
|
if (el.type === "checkbox") {
|
||||||
if (typeof data[id] === "boolean") {
|
if (typeof data[id] === "boolean" && !(id === "trust" && data[id] &&
|
||||||
|
// eslint-disable-next-line no-alert, max-len
|
||||||
|
!confirm("Enable 'trust' setting? Don't enable if you don't trust the source."))) {
|
||||||
el.checked = data[id];
|
el.checked = data[id];
|
||||||
}
|
}
|
||||||
} else if (data[id]) {
|
} else if (data[id]) {
|
||||||
|
Reference in New Issue
Block a user