Skip to content

Commit 2dee17d

Browse files
committed
set initial table from url
1 parent ebbe7ae commit 2dee17d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎mathfont-table.js‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ document.addEventListener("DOMContentLoaded", () => {
7878
const flow = document.getElementById('flow');
7979

8080
if(flow) {
81+
let mmlex="<math display=\"block\"><mfrac><mn>1</mn><mi>x</mi></mfrac><mo>+</mo><msqrt><mi>y</mi></msqrt></math>";
82+
if(mmlP) mmlex=LZString.decompressFromEncodedURIComponent(mmlP);
8183
let i = 0;
8284
for (let value in mathfont_list) {
8385
let tb = document.createElement("table");
@@ -86,7 +88,7 @@ document.addEventListener("DOMContentLoaded", () => {
8688
if ((fontsP && fontsP.charAt(i)!="Y") || ((!fontsP && value=="FontDrop"))) {
8789
sty=" style=\"display:none\"";
8890
}
89-
tb.innerHTML=`<table><thead><tr><th class="${value}"${sty}>${mathfont_list[value]}</th></tr></thead><tbody><tr><td class="mml ${value}"${sty}><math display="block"><mfrac><mn>1</mn><mi>x</mi></mfrac><mo>+</mo><msqrt><mi>y</mi></msqrt></math></td></tr></tbody><table>`;
91+
tb.innerHTML=`<table><thead><tr><th class="${value}"${sty}>${mathfont_list[value]}</th></tr></thead><tbody><tr><td class="mml ${value}"${sty}>${mmlex}</td></tr></tbody><table>`;
9092
flow.appendChild(tb);
9193
i=i+1;
9294
}

0 commit comments

Comments
 (0)