|
|
@@ -1,3 +1,4 @@
|
|
|
+/* jshint sub: true */
|
|
|
|
|
|
var formatText = (function() {
|
|
|
/** @type {string} */
|
|
|
@@ -303,7 +304,7 @@ var formatText = (function() {
|
|
|
function isBeginingOfLine() {
|
|
|
var isNewLine = root.isBeginingOfLine();
|
|
|
return isNewLine === undefined ? true : isNewLine;
|
|
|
- };
|
|
|
+ }
|
|
|
|
|
|
/** @return {number} */
|
|
|
MsgTextLeaf.prototype.addChar = function(i) {
|
|
|
@@ -394,8 +395,8 @@ var formatText = (function() {
|
|
|
var formatted = opts.emojiFormatFunction(fallback);
|
|
|
return formatted ? formatted : fallback;
|
|
|
}
|
|
|
- var formatted = opts.emojiFormatFunction(this.text);
|
|
|
- return formatted ? formatted : this.text;
|
|
|
+ var _formatted = opts.emojiFormatFunction(this.text);
|
|
|
+ return _formatted ? _formatted : this.text;
|
|
|
}
|
|
|
if (this._parent.checkIsCodeBlock()) {
|
|
|
if (typeof hljs !== "undefined") {
|
|
|
@@ -422,10 +423,10 @@ var formatText = (function() {
|
|
|
* @return {string}
|
|
|
**/
|
|
|
MsgTextLeaf.prototype.outerHTML = function() {
|
|
|
- var tagName = 'span'
|
|
|
- ,classList = []
|
|
|
- ,innerHTML
|
|
|
- ,params = '';
|
|
|
+ var tagName = 'span',
|
|
|
+ classList = [],
|
|
|
+ innerHTML,
|
|
|
+ params = '';
|
|
|
|
|
|
if (this._parent.checkIsCodeBlock()) {
|
|
|
tagName = "pre";
|
|
|
@@ -494,7 +495,7 @@ var formatText = (function() {
|
|
|
}
|
|
|
}
|
|
|
return null;
|
|
|
- };
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* @param {MsgBranch} branch
|
|
|
@@ -506,7 +507,7 @@ var formatText = (function() {
|
|
|
branch._parent.lastNode = branch._parent.subNodes[branch._parent.subNodes.length -1];
|
|
|
revertTree(branch._parent, true);
|
|
|
}
|
|
|
- };
|
|
|
+ }
|
|
|
|
|
|
MsgBranch.prototype.implicitClose = function(i) {
|
|
|
if (this.isQuote && !this.terminated) {
|
|
|
@@ -546,7 +547,7 @@ var formatText = (function() {
|
|
|
} else {
|
|
|
// FIXME merge of same block-branches (opti)
|
|
|
}
|
|
|
- };
|
|
|
+ }
|
|
|
|
|
|
function identity(a) { return a; }
|
|
|
|
|
|
@@ -556,7 +557,7 @@ var formatText = (function() {
|
|
|
text: str,
|
|
|
isInternal: false
|
|
|
};
|
|
|
- };
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* @param {string} _text
|
|
|
@@ -586,7 +587,8 @@ var formatText = (function() {
|
|
|
} while (i !== undefined);
|
|
|
|
|
|
return root.outerHTML();
|
|
|
- };
|
|
|
+ }
|
|
|
+
|
|
|
return _parse;
|
|
|
})();
|
|
|
|
|
|
@@ -594,6 +596,6 @@ window['_formatText'] = function(str, opts) {
|
|
|
return formatText(str, {
|
|
|
highlights: opts ? opts["highlights"] : undefined
|
|
|
});
|
|
|
-}
|
|
|
+};
|
|
|
if (typeof module !== "undefined") module.exports.formatText = formatText;
|
|
|
|