File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
src/project/types/website/listing Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -365,10 +365,23 @@ export function readRenderedContents(
365365 } ) ;
366366 }
367367
368+ // Cleans math tags and replaces with qquad
369+ const replaceTagRegex = / \/ t a g \{ ( .* ) \} / g;
370+ const cleanMath = ( contents ?: string ) => {
371+ if ( ! contents ) {
372+ return undefined ;
373+ } else {
374+ // /tag{1} > \qquad(1)
375+ return contents . replaceAll ( replaceTagRegex , ( _match , content ) => {
376+ return `\\qquad{${ content } }` ;
377+ } ) ;
378+ }
379+ } ;
380+
368381 return {
369382 title : titleText ,
370- fullContents : mainEl ?. innerHTML ,
371- firstPara : mainEl ?. querySelector ( "p" ) ?. innerHTML ,
383+ fullContents : cleanMath ( mainEl ?. innerHTML ) ,
384+ firstPara : cleanMath ( mainEl ?. querySelector ( "p" ) ?. innerHTML ) ,
372385 } ;
373386}
374387
You can’t perform that action at this time.
0 commit comments