jenkins-bot has submitted this change and it was merged.
Change subject: dm.Document#newFromHtml: Allow HTMLDocument argument as well as
string
......................................................................
dm.Document#newFromHtml: Allow HTMLDocument argument as well as string
Change-Id: I24250845e97acb4b7de9c495cb46dbd28fc8817e
---
M src/dm/ve.dm.Document.js
1 file changed, 3 insertions(+), 3 deletions(-)
Approvals:
Jforrester: Looks good to me, approved
jenkins-bot: Verified
diff --git a/src/dm/ve.dm.Document.js b/src/dm/ve.dm.Document.js
index f4865f6..0de6326 100644
--- a/src/dm/ve.dm.Document.js
+++ b/src/dm/ve.dm.Document.js
@@ -1300,15 +1300,15 @@
};
/**
- * Create a document given an HTML string.
+ * Create a document given an HTML string or document.
*
* @method
- * @param {string} html HTML to insert
+ * @param {string|HTMLDocument} html HTML string or document to insert
* @param {Object} [importRules] The import rules with which to sanitize the
HTML, if importing
* @return {ve.dm.Document} New document
*/
ve.dm.Document.prototype.newFromHtml = function ( html, importRules ) {
- var htmlDoc = ve.createDocumentFromHtml( html ),
+ var htmlDoc = typeof html === 'string' ? ve.createDocumentFromHtml(
html ) : html,
doc = ve.dm.converter.getModelFromDom( htmlDoc, {
targetDoc: this.getHtmlDocument(),
fromClipboard: !!importRules
--
To view, visit https://gerrit.wikimedia.org/r/279728
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I24250845e97acb4b7de9c495cb46dbd28fc8817e
Gerrit-PatchSet: 2
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits