Skip to content

Commit

Permalink
Trying to come up with a better regular expression for matching empha…
Browse files Browse the repository at this point in the history
…sis in docs.

Old one was breaking on multiplications in code snippets.
  • Loading branch information
alteredq committed Aug 15, 2012
1 parent 07d57df commit ddd4063
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit ddd4063

Please sign in to comment.