diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2017-12-04 18:55:29 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2017-12-04 18:55:29 +0100 |
commit | 1794320dcfdfcd19572fb1676294f9853a6bbc20 (patch) | |
tree | a4c9e978947d6930d50391747382d7f95a5863e3 /sources/plugins/enterkey | |
parent | 7183f6a6a21ad9124e70c997e0168459f377a9f2 (diff) | |
download | ludivine-ckeditor-component-1794320dcfdfcd19572fb1676294f9853a6bbc20.tar.gz ludivine-ckeditor-component-1794320dcfdfcd19572fb1676294f9853a6bbc20.tar.zst ludivine-ckeditor-component-1794320dcfdfcd19572fb1676294f9853a6bbc20.zip |
Diffstat (limited to 'sources/plugins/enterkey')
-rw-r--r-- | sources/plugins/enterkey/plugin.js | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/sources/plugins/enterkey/plugin.js b/sources/plugins/enterkey/plugin.js index 9410bbd..e65555f 100644 --- a/sources/plugins/enterkey/plugin.js +++ b/sources/plugins/enterkey/plugin.js | |||
@@ -43,7 +43,7 @@ | |||
43 | return; | 43 | return; |
44 | 44 | ||
45 | // When range is in nested editable, we have to replace range with this one, | 45 | // When range is in nested editable, we have to replace range with this one, |
46 | // which have root property set to closest editable, to make auto paragraphing work. (#12162) | 46 | // which have root property set to closest editable, to make auto paragraphing work. (http://dev.ckeditor.com/ticket/12162) |
47 | range = replaceRangeWithClosestEditableRoot( range ); | 47 | range = replaceRangeWithClosestEditableRoot( range ); |
48 | 48 | ||
49 | var doc = range.document; | 49 | var doc = range.document; |
@@ -58,9 +58,9 @@ | |||
58 | 58 | ||
59 | newBlock; | 59 | newBlock; |
60 | 60 | ||
61 | // Exit the list when we're inside an empty list item block. (#5376) | 61 | // Exit the list when we're inside an empty list item block. (http://dev.ckeditor.com/ticket/5376) |
62 | if ( atBlockStart && atBlockEnd ) { | 62 | if ( atBlockStart && atBlockEnd ) { |
63 | // Exit the list when we're inside an empty list item block. (#5376) | 63 | // Exit the list when we're inside an empty list item block. (http://dev.ckeditor.com/ticket/5376) |
64 | if ( block && ( block.is( 'li' ) || block.getParent().is( 'li' ) ) ) { | 64 | if ( block && ( block.is( 'li' ) || block.getParent().is( 'li' ) ) ) { |
65 | // Make sure to point to the li when dealing with empty list item. | 65 | // Make sure to point to the li when dealing with empty list item. |
66 | if ( !block.is( 'li' ) ) | 66 | if ( !block.is( 'li' ) ) |
@@ -293,7 +293,7 @@ | |||
293 | 293 | ||
294 | var node; | 294 | var node; |
295 | 295 | ||
296 | // If this is a block under a list item, split it as well. (#1647) | 296 | // If this is a block under a list item, split it as well. (http://dev.ckeditor.com/ticket/1647) |
297 | if ( nextBlock ) { | 297 | if ( nextBlock ) { |
298 | node = nextBlock.getParent(); | 298 | node = nextBlock.getParent(); |
299 | if ( node.is( 'li' ) ) { | 299 | if ( node.is( 'li' ) ) { |
@@ -313,7 +313,7 @@ | |||
313 | if ( !isStartOfBlock && !isEndOfBlock ) { | 313 | if ( !isStartOfBlock && !isEndOfBlock ) { |
314 | // If the next block is an <li> with another list tree as the first | 314 | // If the next block is an <li> with another list tree as the first |
315 | // child, we'll need to append a filler (<br>/NBSP) or the list item | 315 | // child, we'll need to append a filler (<br>/NBSP) or the list item |
316 | // wouldn't be editable. (#1420) | 316 | // wouldn't be editable. (http://dev.ckeditor.com/ticket/1420) |
317 | if ( nextBlock.is( 'li' ) ) { | 317 | if ( nextBlock.is( 'li' ) ) { |
318 | var walkerRange = range.clone(); | 318 | var walkerRange = range.clone(); |
319 | walkerRange.selectNodeContents( nextBlock ); | 319 | walkerRange.selectNodeContents( nextBlock ); |
@@ -335,7 +335,7 @@ | |||
335 | 335 | ||
336 | if ( previousBlock ) { | 336 | if ( previousBlock ) { |
337 | // Do not enter this block if it's a header tag, or we are in | 337 | // Do not enter this block if it's a header tag, or we are in |
338 | // a Shift+Enter (#77). Create a new block element instead | 338 | // a Shift+Enter (http://dev.ckeditor.com/ticket/77). Create a new block element instead |
339 | // (later in the code). | 339 | // (later in the code). |
340 | if ( previousBlock.is( 'li' ) || !( headerTagRegex.test( previousBlock.getName() ) || previousBlock.is( 'pre' ) ) ) { | 340 | if ( previousBlock.is( 'li' ) || !( headerTagRegex.test( previousBlock.getName() ) || previousBlock.is( 'pre' ) ) ) { |
341 | // Otherwise, duplicate the previous block. | 341 | // Otherwise, duplicate the previous block. |
@@ -346,7 +346,7 @@ | |||
346 | } | 346 | } |
347 | 347 | ||
348 | if ( !newBlock ) { | 348 | if ( !newBlock ) { |
349 | // We have already created a new list item. (#6849) | 349 | // We have already created a new list item. (http://dev.ckeditor.com/ticket/6849) |
350 | if ( node && node.is( 'li' ) ) | 350 | if ( node && node.is( 'li' ) ) |
351 | newBlock = node; | 351 | newBlock = node; |
352 | else { | 352 | else { |
@@ -384,8 +384,8 @@ | |||
384 | if ( !newBlock.getParent() ) | 384 | if ( !newBlock.getParent() ) |
385 | range.insertNode( newBlock ); | 385 | range.insertNode( newBlock ); |
386 | 386 | ||
387 | // list item start number should not be duplicated (#7330), but we need | 387 | // list item start number should not be duplicated (http://dev.ckeditor.com/ticket/7330), but we need |
388 | // to remove the attribute after it's onto the DOM tree because of old IEs (#7581). | 388 | // to remove the attribute after it's onto the DOM tree because of old IEs (http://dev.ckeditor.com/ticket/7581). |
389 | newBlock.is( 'li' ) && newBlock.removeAttribute( 'value' ); | 389 | newBlock.is( 'li' ) && newBlock.removeAttribute( 'value' ); |
390 | 390 | ||
391 | // This is tricky, but to make the new block visible correctly | 391 | // This is tricky, but to make the new block visible correctly |
@@ -453,7 +453,7 @@ | |||
453 | } else { | 453 | } else { |
454 | var lineBreak; | 454 | var lineBreak; |
455 | 455 | ||
456 | // IE<8 prefers text node as line-break inside of <pre> (#4711). | 456 | // IE<8 prefers text node as line-break inside of <pre> (http://dev.ckeditor.com/ticket/4711). |
457 | if ( startBlockTag == 'pre' && CKEDITOR.env.ie && CKEDITOR.env.version < 8 ) | 457 | if ( startBlockTag == 'pre' && CKEDITOR.env.ie && CKEDITOR.env.version < 8 ) |
458 | lineBreak = doc.createText( '\r' ); | 458 | lineBreak = doc.createText( '\r' ); |
459 | else | 459 | else |
@@ -503,7 +503,7 @@ | |||
503 | function shiftEnter( editor ) { | 503 | function shiftEnter( editor ) { |
504 | // On SHIFT+ENTER: | 504 | // On SHIFT+ENTER: |
505 | // 1. We want to enforce the mode to be respected, instead | 505 | // 1. We want to enforce the mode to be respected, instead |
506 | // of cloning the current block. (#77) | 506 | // of cloning the current block. (http://dev.ckeditor.com/ticket/77) |
507 | return enter( editor, editor.activeShiftEnterMode, 1 ); | 507 | return enter( editor, editor.activeShiftEnterMode, 1 ); |
508 | } | 508 | } |
509 | 509 | ||
@@ -521,7 +521,8 @@ | |||
521 | // Check path block specialities: | 521 | // Check path block specialities: |
522 | // 1. Cannot be a un-splittable element, e.g. table caption; | 522 | // 1. Cannot be a un-splittable element, e.g. table caption; |
523 | var path = editor.elementPath(); | 523 | var path = editor.elementPath(); |
524 | if ( !path.isContextFor( 'p' ) ) { | 524 | |
525 | if ( path && !path.isContextFor( 'p' ) ) { | ||
525 | mode = CKEDITOR.ENTER_BR; | 526 | mode = CKEDITOR.ENTER_BR; |
526 | forceMode = 1; | 527 | forceMode = 1; |
527 | } | 528 | } |