Skip to content

Commit 9a29ba7

Browse files
author
Hamada Gasmallah
committed
fix: logging info about mathjax to help debug
1 parent d702740 commit 9a29ba7

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "backstage-plugin-techdocs-addon-mathjax",
3-
"version": "0.0.3",
3+
"version": "0.0.4a",
44
"main": "src/index.ts",
55
"types": "src/index.ts",
66
"license": "MIT",

src/Mathjax/Mathjax.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,16 @@ let mathjaxPromise = init(mathjaxConfig);
2727

2828
async function processMathjax(preBlock: any){
2929
if (!mathjax){
30+
console.log("Mathjax not found. Loading Mathjax!");
3031
mathjax = await mathjaxPromise;
3132
}
3233

34+
console.log("Found preBlock with values: ", preBlock.innerText);
3335
const blockText = preBlock.innerText;
3436
const svg = mathjax.tex2svg( blockText );
3537
const svgHTML = mathjax.startup.adaptor.outerHTML(svg);
3638
preBlock.innerHTML = svgHTML;
37-
39+
console.log("preBlock has generated svg, now setting innerHTML to svg");
3840
};
3941

4042

@@ -45,6 +47,7 @@ export const MathjaxAddon = () => {
4547
useEffect(()=>{
4648

4749
mathjaxPreBlocks.forEach(preBlock =>{
50+
console.log(">>FOREACH");
4851
processMathjax(preBlock);
4952
});
5053

0 commit comments

Comments
 (0)