mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-06 03:38:39 +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>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="trust">trust</label></td>
|
||||
<td><input type="checkbox" id="trust"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
<h4><label for="macros">macros</label></h4>
|
||||
<textarea id="macros" placeholder="JSON">
|
||||
|
@@ -48,10 +48,12 @@ window.WebFontConfig = {
|
||||
}
|
||||
|
||||
var katexOptions = ["displayMode", "leqno", "fleqn", "throwOnError",
|
||||
"errorColor", "strict", "macros"].map(function(id) {
|
||||
"errorColor", "strict", "trust", "macros"].map(function(id) {
|
||||
var el = document.getElementById(id);
|
||||
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];
|
||||
}
|
||||
} else if (data[id]) {
|
||||
|
Reference in New Issue
Block a user