Browse Source

markdown: improve multiline $ifNull output (only 2nd operand)

Kyle P Davis 10 years ago
parent
commit
8319148ba0
1 changed files with 3 additions and 5 deletions
  1. 3 5
      lib/extras/markdown.js

+ 3 - 5
lib/extras/markdown.js

@@ -334,12 +334,10 @@ function toListItem(str, i) {
 
 		expressions.IfNullExpression.prototype.getMarkdown = function(level) {
 			var str = getIndentStr(level);
-
 			var opExpDocStr = this.operands[0].getMarkdown(0).trimRight(),
-				opOtherExpDocStr = this.operands[1].getMarkdown(0).trimRight();
-			str += opExpDocStr + " if not null or fallback to " + opOtherExpDocStr;
-
-			if (str.indexOf("\n") !== -1) throw new Error("TODO: fix multiline $ifNull output");
+				opOtherExpDocStr = this.operands[1].getMarkdown(level).trimRight();
+			str += opExpDocStr + " if not null or fallback to " + opOtherExpDocStr.trimLeft();
+			if (opExpDocStr.indexOf("\n") !== -1) throw new Error("TODO: fix multiline $ifNull output");
 			str += "\n";
 			return str;
 		};