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<
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 (
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 ) {
428
439
this . markInlineBreaks ( math . root . childNodes ?. [ 0 ] ) ;
429
440
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 ) ;
433
442
}
434
443
math . root . setTeXclass ( null ) ;
435
444
const wrapper = this . factory . wrap ( math . root ) ;
You can’t perform that action at this time.
0 commit comments