Mercurial Hosting > sceditor
comparison src/sceditor.js @ 37:0c4e4b5ef40d
remove fragmentToHtml
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 17 Aug 2022 12:00:57 -0600 |
parents | 21090996a131 |
children | 2dfdaaac9482 |
comparison
equal
deleted
inserted
replaced
36:21090996a131 | 37:0c4e4b5ef40d |
---|---|
5608 } | 5608 } |
5609 | 5609 |
5610 pluginManager.call('paste', paste); | 5610 pluginManager.call('paste', paste); |
5611 trigger(editorContainer, 'paste', paste); | 5611 trigger(editorContainer, 'paste', paste); |
5612 | 5612 |
5613 if ('fragmentToHtml' in format) { | |
5614 paste.val = format | |
5615 .fragmentToHtml(paste.val, currentNode); | |
5616 } | |
5617 | |
5618 pluginManager.call('pasteHtml', paste); | 5613 pluginManager.call('pasteHtml', paste); |
5619 | 5614 |
5620 var parent = rangeHelper.getFirstBlockParent(); | 5615 var parent = rangeHelper.getFirstBlockParent(); |
5621 base.wysiwygEditorInsertHtml(paste.val, null, true); | 5616 base.wysiwygEditorInsertHtml(paste.val, null, true); |
5622 merge(parent); | 5617 merge(parent); |
5909 * escaped | 5904 * escaped |
5910 * | 5905 * |
5911 * @param {string} start | 5906 * @param {string} start |
5912 * @param {string} [end=null] | 5907 * @param {string} [end=null] |
5913 * @param {boolean} [filter=true] | 5908 * @param {boolean} [filter=true] |
5914 * @param {boolean} [convertEmoticons=true] If to convert emoticons | |
5915 * @param {boolean} [allowMixed=false] | 5909 * @param {boolean} [allowMixed=false] |
5916 * @return {this} | |
5917 * @since 1.4.3 | 5910 * @since 1.4.3 |
5918 * @function | 5911 * @function |
5919 * @name insert^2 | 5912 * @name insert^2 |
5920 */ | 5913 */ |
5921 // eslint-disable-next-line max-params | 5914 // eslint-disable-next-line max-params |
5922 base.insert = function ( | 5915 base.insert = function ( |
5923 start, end, filter, convertEmoticons, allowMixed | 5916 start, end, filter, allowMixed |
5924 ) { | 5917 ) { |
5925 if (base.inSourceMode()) { | 5918 if (base.inSourceMode()) { |
5926 base.sourceEditorInsertText(start, end); | 5919 base.sourceEditorInsertText(start, end); |
5927 return; | 5920 return; |
5928 } | 5921 } |
5935 html = format | 5928 html = format |
5936 .fragmentToSource(html, wysiwygDocument, currentNode); | 5929 .fragmentToSource(html, wysiwygDocument, currentNode); |
5937 } | 5930 } |
5938 | 5931 |
5939 start += html + end; | 5932 start += html + end; |
5940 } | |
5941 // TODO: This filter should allow empty tags as it's inserting. | |
5942 if (filter !== false && 'fragmentToHtml' in format) { | |
5943 start = format.fragmentToHtml(start, currentNode); | |
5944 } | 5933 } |
5945 | 5934 |
5946 // Convert any escaped HTML back into HTML if mixed is allowed | 5935 // Convert any escaped HTML back into HTML if mixed is allowed |
5947 if (filter !== false && allowMixed === true) { | 5936 if (filter !== false && allowMixed === true) { |
5948 start = start.replace(/</g, '<') | 5937 start = start.replace(/</g, '<') |