Skip to content

Commit

Permalink
Docs: Improved [link:] handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed May 27, 2021
1 parent b67a3f7 commit 86faaca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ function onDocumentLoad() {
text = text.replace( /\[(?:member|property|method):([\w]+) ([\w\.\s]+)\]\s*(\(.*\))?/gi, '<a onclick="window.parent.setUrlFragment(\'' + name + '.$2\')" target="_parent" title="' + name + '.$2" class="permalink">#</a> .<a onclick="window.parent.setUrlFragment(\'' + name + '.$2\')" id="$2">$2</a> $3 : <a class="param" onclick="window.parent.setUrlFragment(\'$1\')">$1</a>' );
text = text.replace( /\[param:([\w\.]+) ([\w\.\s]+)\]/gi, '$2 : <a class="param" onclick="window.parent.setUrlFragment(\'$1\')">$1</a>' ); // [param:name title]

text = text.replace( /\[link:([\w|\:|\/|\.|\-|\_]+)\]/gi, '[link:$1 $1]' ); // [link:url] to [link:url title]
text = text.replace( /\[link:([\w|\:|\/|\.|\-|\_|\(|\)|\?|\#|\=|\!]+) ([\w|\:|\/|\.|\-|\_|\s]+)\]/gi, '<a href="$1" target="_blank">$2</a>' ); // [link:url title]
text = text.replace( /\[link:([\w|\:|\/|\.|\-|\_|\(|\)|\?|\#|\=|\!|\~]+)\]/gi, '<a href="$1" target="_blank">$1</a>' ); // [link:url]
text = text.replace( /\[link:([\w|\:|\/|\.|\-|\_|\(|\)|\?|\#|\=|\!|\~]+) ([\w|\:|\/|\.|\-|\_|\'|\s]+)\]/gi, '<a href="$1" target="_blank">$2</a>' ); // [link:url title]
text = text.replace( /\*([\w|\d|\"|\-|\(][\w|\d|\ |\-|\/|\+|\-|\(|\)|\=|\,|\.\"]*[\w|\d|\"|\)]|\w)\*/gi, '<strong>$1</strong>' ); // *

text = text.replace( /\[example:([\w\_]+)\]/gi, '[example:$1 $1]' ); // [example:name] to [example:name title]
Expand Down

0 comments on commit 86faaca

Please sign in to comment.