File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -139,6 +139,8 @@ export async function bookBibliographyPostRender(
139139 // still used by citations-hover)
140140 const citeIds : string [ ] = [ ] ;
141141 for ( const file of outputFiles ) {
142+ let changed = false ;
143+
142144 // relative path to refs html
143145 const refsRelative = pathWithForwardSlashes (
144146 relative ( dirname ( file . file ) , refsHtml ! ) ,
@@ -153,13 +155,23 @@ export async function bookBibliographyPostRender(
153155 for ( let l = 0 ; l < citeLinks . length ; l ++ ) {
154156 const link = citeLinks [ l ] as Element ;
155157 link . setAttribute ( "href" , refsRelative + link . getAttribute ( "href" ) ) ;
158+ changed = true ;
156159 }
157160 } ) ;
158161
159162 // hide the bibliography
160163 const refsDiv = doc . getElementById ( "refs" ) ;
161164 if ( refsDiv ) {
162165 refsDiv . setAttribute ( "style" , "display: none" ) ;
166+ changed = true ;
167+ }
168+
169+ if ( changed ) {
170+ await writeDomToHtmlFile (
171+ doc ,
172+ file . file ,
173+ file . doctype ,
174+ ) ;
163175 }
164176 }
165177
You can’t perform that action at this time.
0 commit comments