diff src/formats/bbcode.js @ 37:0c4e4b5ef40d

remove fragmentToHtml
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 17 Aug 2022 12:00:57 -0600
parents 21090996a131
children 7491026f7623
line wrap: on
line diff
--- a/src/formats/bbcode.js	Tue Aug 16 13:50:36 2022 -0600
+++ b/src/formats/bbcode.js	Wed Aug 17 12:00:57 2022 -0600
@@ -2448,20 +2448,14 @@
 		/**
 		 * Converts BBCode into HTML
 		 *
-		 * @param {boolean} asFragment
 		 * @param {string} source
-		 * @param {boolean} [legacyAsFragment] Used by fromBBCode() method
 		 */
-		function toHtml(asFragment) {
-			return function(source, legacyAsFragment) {
-				var	parser = newBBCodeParser(base.editor);
-				var html = parser.toHTML(
-					base.opts.bbcodeTrim ? source.trim() : source
-				);
-
-				return (asFragment || legacyAsFragment) ?
-					removeFirstLastDiv(html) : html;
-			};
+		function toHtml(source) {
+			let parser = newBBCodeParser(base.editor);
+			let html = parser.toHTML(
+				base.opts.bbcodeTrim ? source.trim() : source
+			);
+			return html;
 		}
 
 		/**
@@ -2525,8 +2519,7 @@
 			};
 		}
 
-		base.toHtml = toHtml(false);
-		base.fragmentToHtml = toHtml(true);
+		base.toHtml = toHtml;
 		base.toSource = toSource(false);
 		base.fragmentToSource = toSource(true);