File tree 2 files changed +13
-4
lines changed
2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -681,10 +681,15 @@ fn make_data(
681
681
data. insert ( "mathjax_support" . to_owned ( ) , json ! ( true ) ) ;
682
682
} else if html_config. mathjax . enable {
683
683
data. insert ( "mathjax_enable" . to_owned ( ) , json ! ( true ) ) ;
684
- data. insert (
685
- "mathjax_source" . to_owned ( ) ,
686
- json ! ( html_config. mathjax. source) ,
687
- ) ;
684
+ if let Some ( ref source) = html_config. mathjax . source {
685
+ if source. starts_with ( "/" ) {
686
+ data. insert ( "mathjax_root" . to_owned ( ) , json ! ( true ) ) ;
687
+ let ( _, relative_source) = source. split_at ( 1 ) ;
688
+ data. insert ( "mathjax_source" . to_owned ( ) , json ! ( relative_source) ) ;
689
+ } else {
690
+ data. insert ( "mathjax_source" . to_owned ( ) , json ! ( source) ) ;
691
+ }
692
+ }
688
693
data. insert (
689
694
"mathjax_config" . to_owned ( ) ,
690
695
json ! ( html_config. mathjax. config) ,
Original file line number Diff line number Diff line change 67
67
};
68
68
</script >
69
69
{{ /if }}
70
+ {{ #if mathjax_root }}
71
+ <script id =" MathJax-script" async src =" {{ path_to_root }}{{ mathjax_source }} /{{ mathjax_config }} .js" ></script >
72
+ {{ else }}
70
73
<script id =" MathJax-script" async src =" {{ mathjax_source }} /{{ mathjax_config }} .js" ></script >
71
74
{{ /if }}
72
75
{{ /if }}
76
+ {{ /if }}
73
77
</head >
74
78
<body >
75
79
<div id =" body-container" >
You can’t perform that action at this time.
0 commit comments