Skip to content

Commit 633575c

Browse files
committed
JS script removes new from TOC if Menlo font not present
1 parent 0690c8f commit 633575c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

web/script_2.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ const DIAGRAM_2_B =
4646
(function(d){function c(c){b.style.fontFamily=c;e.appendChild(b);f=b.clientWidth;e.removeChild(b);return f}var f,e=d.body,b=d.createElement("span");b.innerHTML=Array(100).join("wi");b.style.cssText=["position:absolute","width:auto","font-size:128px","left:-99999px"].join(" !important;");var g=c("monospace"),h=c("serif"),k=c("sans-serif");window.isFontAvailable=function(b){return g!==c(b+",monospace")||k!==c(b+",sans-serif")||h!==c(b+",serif")}})(document);
4747

4848
if (!isFontAvailable('Menlo')) {
49-
$(`code:contains(${DIAGRAM_1_B})`).html(DIAGRAM_1_A)
50-
$(`code:contains(${DIAGRAM_2_B})`).html(DIAGRAM_2_A)
49+
$(`code:contains(${DIAGRAM_1_B})`).html(DIAGRAM_1_A);
50+
$(`code:contains(${DIAGRAM_2_B})`).html(DIAGRAM_2_A);
51+
var htmlString = $('code:contains(ᴺᴱᵂ)').html().replace(//g, '');
52+
$('code:contains(ᴺᴱᵂ)').html(htmlString);
5153
}
5254

5355

0 commit comments

Comments
 (0)