mirror of
https://github.com/fastmail/Squire.git
synced 2024-12-22 15:23:29 -05:00
Add config.addLinks
This commit is contained in:
parent
9218c9ba14
commit
1850e2cdae
2 changed files with 8 additions and 3 deletions
|
@ -187,7 +187,8 @@ proto.setConfig = function ( config ) {
|
|||
sanitizeToDOMFragment:
|
||||
typeof DOMPurify !== 'undefined' && DOMPurify.isSupported ?
|
||||
sanitizeToDOMFragment : null,
|
||||
willCutCopy: null
|
||||
willCutCopy: null,
|
||||
addLinks: true
|
||||
}, config, true );
|
||||
|
||||
// Users may specify block tag in lower case
|
||||
|
|
|
@ -153,7 +153,9 @@ var handleEnter = function ( self, shiftKey, range ) {
|
|||
// Remove any zws so we don't think there's content in an empty
|
||||
// block.
|
||||
self._recordUndoState( range );
|
||||
if ( self._config.addLinks ) {
|
||||
addLinks( range.startContainer, root, self );
|
||||
}
|
||||
self._removeZWS();
|
||||
self._getRangeAndRemoveBookmark( range );
|
||||
|
||||
|
@ -504,7 +506,9 @@ var keyHandlers = {
|
|||
var node, parent;
|
||||
var root = self._root;
|
||||
self._recordUndoState( range );
|
||||
if ( self._config.addLinks ) {
|
||||
addLinks( range.startContainer, root, self );
|
||||
}
|
||||
self._getRangeAndRemoveBookmark( range );
|
||||
|
||||
// If the cursor is at the end of a link (<a>foo|</a>) then move it
|
||||
|
|
Loading…
Reference in a new issue