Created
October 2, 2018 23:41
-
-
Save neonxp/695df01a3259b67ce75d077d3c9b4efa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rep(/\n/gi, "<br />"); | |
rep(/\[\[button\s+([a-z0-9\-_]+)(?:\s+(.+?))?\]\]/i,"<a href='#'>WDButton::$1</a>"); | |
rep(/\*\*(.*?)\*\*/gi,"<span style=\"font-weight: bold;\">$1</span>"); | |
rep(/--(.*?)--/gi,"<span style=\"text-decoration: line-through;\">$1</span>"); | |
rep(/\{\{(.*?)\}\}/gi,"<pre>$1</pre>"); | |
rep(/\^\^(.*?)\^\^/gi,"<sup>$1</sup>"); | |
rep(/,,(.*?),,/gi,"<sub>$1</sub>"); | |
rep(/\[\[span(.*)?\]\](.*?)\[\[\/span\]\]/mi,"<span $1>$2</span>"); | |
rep(/\[\[table(.*)?\]\](.*?)\[\[\/table\]\]/mi,"<table$1>$2</table>"); | |
rep(/\[\[row(.*)?\]\](.*?)\[\[\/row\]\]/mi,"<tr$1>$2</tr>"); | |
rep(/\[\[cell(.*)?\]\](.*?)\[\[\/cell\]\]/mi,"<th$1>$2</th>"); | |
rep(/\[\[size ([a-zA-Z]+|.*?(%|em|px))\]\](.*?)\[\[\/size\]\]/gi,"<span style=\"font-size: $1\">$3</span>"); | |
rep(/\#\#([a-zA-Z]+)\|(.+?)\#\#/,"<span style=\"color: $1;\">$2</span>"); | |
rep(/\#\#([0-9A-Fa-f]{6})\|(.+?)\#\#/,"<span style=\"color: #$1;\">$2</span>"); | |
rep(/\/\/(.*?)\/\//gi,"<span style=\"font-style: italic;\">$1</span>"); | |
rep(/__(.*?)__/gi,"<span style=\"text-decoration: underline;\">$1</span>"); | |
rep(/\[\[image ([^\"]*?)\]\]/gi,"<img src=\"$1\" />"); | |
rep(/^\* (.*?)$/gi, "<li>$1</li>"); | |
rep(/\[\[image ([^\"]*?)\]\]/gi,"<img src=\"$1\" />"); | |
rep(/\[([^\]]+) ([\s\S]*?)\]/gi,"<a href=\"$1\">$2</a>"); | |
rep(/\[code\]([\s\S]*?)\[\/code\]/gi,"<pre>$1</pre> "); | |
rep(/(\[\[# )([-_A-Za-z0-9.%]+?)(\]\])/i,"<a name=\"$2\"></a>"); | |
rep(/\(\(bibcite\s([a-z0-9]+)\)\)/i,"Not Yet Supported"); | |
rep(/ _\n/,"<br />\n"); | |
rep(/\n\= (.*?)\n/,'<p style="text-align: center;">$1</p>'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment