start_tag += '>';
var end_tag = '</'+params.tag+'>';
+if(text.length > 0) {
// tokenize
var output = ''
var token = ''
} else {
output += end_tag;
}
-
output += token;
+}
+else {
+ output = start_tag + end_tag;
+}
texteditor.replaceSelection(output);