File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -423,13 +423,18 @@ export abstract class CommonOutputJax<
423
423
if ( linebreak ) {
424
424
this . getLinebreakWidth ( ) ;
425
425
}
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 ( inlineMarked && ( ! makeBreaks || this . forceInlineBreaks !== math . root . getProperty ( 'inlineForced' ) ) ) {
429
+ this . unmarkInlineBreaks ( math . root ) ;
430
+ math . root . removeProperty ( 'inlineMarked' ) ;
431
+ math . root . removeProperty ( 'inlineForced' ) ;
432
+ inlineMarked = false ;
433
+ }
434
+ if ( makeBreaks && ! inlineMarked ) {
428
435
this . markInlineBreaks ( math . root . childNodes ?. [ 0 ] ) ;
429
436
math . root . setProperty ( 'inlineMarked' , true ) ;
430
- } else if ( ! this . options . linebreaks . inline && inlineMarked ) {
431
- this . unmarkInlineBreaks ( math . root ) ;
432
- math . root . setProperty ( 'inlineMarked' , false ) ;
437
+ math . root . setProperty ( 'inlineForced' , this . forceInlineBreaks ) ;
433
438
}
434
439
math . root . setTeXclass ( null ) ;
435
440
const wrapper = this . factory . wrap ( math . root ) ;
You can’t perform that action at this time.
0 commit comments