|
@@ -48,15 +48,22 @@
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- let text = document.body.innerHTML;
|
|
|
|
|
|
|
+ const parts = window.location.href.split( '/' );
|
|
|
|
|
+ const filename = parts[ parts.length - 1 ];
|
|
|
|
|
|
|
|
- text = text.replace( /\[link:([\w\:\/\.\-\_\(\)\?\#\=\!\~]+)\]/gi, '<a href="$1" target="_blank">$1</a>' ); // [link:url]
|
|
|
|
|
- text = text.replace( /\[link:([\w:/.\-_()?#=!~]+) ([\w\p{L}:/.\-_'\s]+)\]/giu, '<a href="$1" target="_blank">$2</a>' ); // [link:url title]
|
|
|
|
|
- text = text.replace( /\[example:([\w\_]+)\]/gi, '[example:$1 $1]' ); // [example:name] to [example:name title]
|
|
|
|
|
- text = text.replace( /\[example:([\w\_]+) ([\w\:\/\.\-\_ \s]+)\]/gi, '<a href="../../examples/#$1" target="_blank">$2</a>' ); // [example:name title]
|
|
|
|
|
- text = text.replace( /\`(.*?)\`/gs, '<code class="notranslate" translate="no">$1</code>' ); // `code`
|
|
|
|
|
|
|
+ if ( filename !== 'primitives.html' ) {
|
|
|
|
|
|
|
|
- document.body.innerHTML = text;
|
|
|
|
|
|
|
+ let text = document.body.innerHTML;
|
|
|
|
|
+
|
|
|
|
|
+ text = text.replace( /\[link:([\w\:\/\.\-\_\(\)\?\#\=\!\~]+)\]/gi, '<a href="$1" target="_blank">$1</a>' ); // [link:url]
|
|
|
|
|
+ text = text.replace( /\[link:([\w:/.\-_()?#=!~]+) ([\w\p{L}:/.\-_'\s]+)\]/giu, '<a href="$1" target="_blank">$2</a>' ); // [link:url title]
|
|
|
|
|
+ text = text.replace( /\[example:([\w\_]+)\]/gi, '[example:$1 $1]' ); // [example:name] to [example:name title]
|
|
|
|
|
+ text = text.replace( /\[example:([\w\_]+) ([\w\:\/\.\-\_ \s]+)\]/gi, '<a href="../../examples/#$1" target="_blank">$2</a>' ); // [example:name title]
|
|
|
|
|
+ text = text.replace( /\`(.*?)\`/gs, '<code class="notranslate" translate="no">$1</code>' ); // `code`
|
|
|
|
|
+
|
|
|
|
|
+ document.body.innerHTML = text;
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
if ( window.prettyPrint ) {
|
|
if ( window.prettyPrint ) {
|
|
|
|
|
|