Selaa lähdekoodia

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 vuotta sitten
vanhempi
commit
ddd4063cae
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  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;