浏览代码

Trying to come up with a better regular expression for matching emphasis in docs.

Old one was breaking on multiplications in code snippets.
alteredq 13 年之前
父节点
当前提交
ddd4063cae
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      docs/page.js

+ 1 - 1
docs/page.js

@@ -11,7 +11,7 @@ var onDocumentLoad = function ( event ) {
 	text = text.replace(/\[page:(\w+) ([\w|\.]+)\]/gi, "<a href=\"javascript:window.parent.goTo('$1')\" title=\"$1\">$2</a>" ); // [page:name title]
 	text = text.replace(/\[link:([\w|\:|\/|\.|\-|\_]+)\]/gi, "[link:$1 $1]" ); // [link:url] to [link:url title]
 	text = text.replace(/\[link:([\w|\:|\/|\.|\-|\_]+) ([\w|\:|\/|\.|\-|\_]+)\]/gi, "<a href=\"$1\"  target=\"_blank\">$2</a>" ); // [link:url title]
-	text = text.replace(/\*([\w|\ |\-|\/|\+|\-|\(|\)|\=|\,|\.\"]+)\*/gi, "<strong>$1</strong>" ); // *
+	text = text.replace(/\*([\w|\"][\w|\ |\-|\/|\+|\-|\(|\)|\=|\,|\.\"]+[\w|\"]|\w)\*/gi, "<strong>$1</strong>" ); // *
 
 	document.body.innerHTML = text;