mirror of
https://github.com/fastmail/Squire.git
synced 2024-12-22 23:40:35 -05:00
Merge pull request #126 from gertsonderby/include-img-in-addFormat
Allow IMG tags to be made into links
This commit is contained in:
commit
ed7bb2736f
3 changed files with 12 additions and 4 deletions
|
@ -2859,12 +2859,16 @@ proto._addFormat = function ( tag, attributes, range ) {
|
|||
// Therefore we wrap this in the tag as well, as this will then cause it
|
||||
// to apply when the user types something in the block, which is
|
||||
// presumably what was intended.
|
||||
//
|
||||
// IMG tags are included because we may want to create a link around them,
|
||||
// and adding other styles is harmless.
|
||||
walker = new TreeWalker(
|
||||
range.commonAncestorContainer,
|
||||
SHOW_TEXT|SHOW_ELEMENT,
|
||||
function ( node ) {
|
||||
return ( node.nodeType === TEXT_NODE ||
|
||||
node.nodeName === 'BR' ) &&
|
||||
node.nodeName === 'BR'||
|
||||
node.nodeName === 'IMG' ) &&
|
||||
isNodeContainedInRange( range, node, true );
|
||||
},
|
||||
false
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -734,12 +734,16 @@ proto._addFormat = function ( tag, attributes, range ) {
|
|||
// Therefore we wrap this in the tag as well, as this will then cause it
|
||||
// to apply when the user types something in the block, which is
|
||||
// presumably what was intended.
|
||||
//
|
||||
// IMG tags are included because we may want to create a link around them,
|
||||
// and adding other styles is harmless.
|
||||
walker = new TreeWalker(
|
||||
range.commonAncestorContainer,
|
||||
SHOW_TEXT|SHOW_ELEMENT,
|
||||
function ( node ) {
|
||||
return ( node.nodeType === TEXT_NODE ||
|
||||
node.nodeName === 'BR' ) &&
|
||||
node.nodeName === 'BR'||
|
||||
node.nodeName === 'IMG' ) &&
|
||||
isNodeContainedInRange( range, node, true );
|
||||
},
|
||||
false
|
||||
|
|
Loading…
Reference in a new issue