File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -423,13 +423,22 @@ export abstract class CommonOutputJax<
423423 if ( linebreak ) {
424424 this . getLinebreakWidth ( ) ;
425425 }
426- const inlineMarked = ! ! math . root . getProperty ( 'inlineMarked' ) ;
427- if ( this . options . linebreaks . inline && ! math . display && ! inlineMarked ) {
426+ const makeBreaks = this . options . linebreaks . inline && ! math . display ;
427+ let inlineMarked = ! ! math . root . getProperty ( 'inlineMarked' ) ;
428+ if (
429+ inlineMarked &&
430+ ( ! makeBreaks ||
431+ this . forceInlineBreaks !== math . root . getProperty ( 'inlineForced' ) )
432+ ) {
433+ this . unmarkInlineBreaks ( math . root ) ;
434+ math . root . removeProperty ( 'inlineMarked' ) ;
435+ math . root . removeProperty ( 'inlineForced' ) ;
436+ inlineMarked = false ;
437+ }
438+ if ( makeBreaks && ! inlineMarked ) {
428439 this . markInlineBreaks ( math . root . childNodes ?. [ 0 ] ) ;
429440 math . root . setProperty ( 'inlineMarked' , true ) ;
430- } else if ( ! this . options . linebreaks . inline && inlineMarked ) {
431- this . unmarkInlineBreaks ( math . root ) ;
432- math . root . setProperty ( 'inlineMarked' , false ) ;
441+ math . root . setProperty ( 'inlineForced' , this . forceInlineBreaks ) ;
433442 }
434443 math . root . setTeXclass ( null ) ;
435444 const wrapper = this . factory . wrap ( math . root ) ;
You can’t perform that action at this time.
0 commit comments