This repository was archived by the owner on May 5, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
packages/plugin-inline/src Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { Constructor } from '../../utils/src/utils';
88import { VNode } from '../../core/src/VNodes/VNode' ;
99import { Modifiers } from '../../core/src/Modifiers' ;
1010import { CssStyle } from '../../plugin-xml/src/CssStyle' ;
11+ import { LineBreakNode } from '../../plugin-linebreak/src/LineBreakNode' ;
1112import { Loadables } from '../../core/src/JWEditor' ;
1213import { Renderer } from '../../plugin-renderer/src/Renderer' ;
1314import { InlineFormatDomObjectRenderer } from './InlineFormatDomObjectRenderer' ;
@@ -147,7 +148,10 @@ export class Inline<T extends JWPluginConfig = JWPluginConfig> extends JWPlugin<
147148
148149 let inlineToCopyModifiers : VNode ;
149150 if ( range . isCollapsed ( ) ) {
150- inlineToCopyModifiers = range . start . previousSibling ( ) || range . start . nextSibling ( ) ;
151+ // TODO: LineBreakNode should have the formats as well.
152+ inlineToCopyModifiers =
153+ range . start . previousSibling ( node => ! node . test ( LineBreakNode ) ) ||
154+ range . start . nextSibling ( ) ;
151155 } else {
152156 inlineToCopyModifiers = range . start . nextSibling ( ) ;
153157 }
You can’t perform that action at this time.
0 commit comments