JSFiddle - React, Tailwind, and code Playground
by Misiur
HTML
<div id="post_message_819593">
<font size="5"><font color="red"><b><u><font color="green">Contents</font></u></b></font></font><br>
<br>
<a href="http://forum.sa-mp.com/showthread.php?p=784802#post784802" target="_blank"><u>Part 1</u></a> - Covers an introduction to the pre-processor and covers some important things when writing function-like macros.<br>
<a href="http://forum.sa-mp.com/showthread.php?p=785175#post785175" target="_blank"><u>Part 2</u></a> - Explains exactly what the compiler searches for and looks at some common macro uses.<br>
<a href="http://forum.sa-mp.com/showthread.php?p=819593#post819593" target="_blank"><u>Part 3</u></a> - Describes the other directives available (beside "#define") and looks at definitions with no replacement value.<br>
<a href="http://forum.sa-mp.com/showthread.php?p=871160#post871160" target="_blank"><u>Part 4</u></a> - How to use strings with the pre-processor.<br>
<a href="http://forum.sa-mp.com/showthread.php?p=898784#post898784" target="_blank"><u>Part 5</u></a> - Alternatives to the pre-processor, multiple symbols and recursion.<br>
<a href="http://forum.sa-mp.com/showthread.php?p=1847269#post1847269" target="_blank"><u>Part 6</u></a> - Case Study (y_remote).<br>
<a href="http://forum.sa-mp.com/showthread.php?p=2494362#post2494362" target="_blank"><u>Part 7</u></a> - Macro issues and spaces.<br>
<br>
<font size="5"><font color="red"><b><u><font color="green">Additional</font></u></b></font></font><br>
<br>
<a href="http://forum.sa-mp.com/showthread.php?p=877901#post877901" target="_blank"><u>Utilising tagof</u></a> - By g_aSlice.<br>
<a href="http://forum.sa-mp.com/showthread.php?p=1076208#post1076208" target="_blank"><u>Future-proof string concatenation</u></a><br>
<a href="http://forum.sa-mp.com/showthread.php?p=1120377#post1120377" target="_blank"><u>String bug</u></a><br>
<a href="http://forum.sa-mp.com/showthread.php?p=1103639#post1103639" target="_blank"><u>Macros that do multiple things</u></a><br>
<a...
JavaScript
var
$body = $('body'),
content = $body.html()
;
//Add code tags
content = content.replace(/<div class="smallfont" style="margin-bottom:2px">pawn Code:<\/div>/ig, '[pawn]');
content = content.replace(/<div class="smallfont" style="margin-bottom:2px">Code:<\/div>/ig, '[code]');
content = content.replace(/<\/div><\/div><\/pre>/img, '[/pawn]');
content = content.replace(/<\/pre>(\s*)<\/div>/mig, '[/code]');
//Replace lists
content = content.replace(/<(\/?)ul>/ig, '[$1list]');
content = content.replace(/<li>/ig, '[*]');
//Remove pres and divs
content = content.replace(/<(\/?)(pre|div|li|span)[^>]*>/gim, '');
//Replace links
content = content.replace(/<a href="([^"]*)"([^>]*)><u>/gi, '[url=$1]');
content = content.replace(/<\/u><\/a>/gi, '[/url]');
//Replace headings
content = content.replace(/<font size="(\d+)"><font color="red"><b><u><font color="green">(.*)<\/font><\/u><\/b><\/font><\/font>/gi, '[size=$1][color=green][b][u]$2[/u][/b][/color][/size]');
//Remove whitespace in code section
content = content.replace(/(\[(pawn|code)\])([\s])*/gim, '$1');
//Styles
content = content.replace(/<(\/?)(b|u)>/gim, '[$1$2]');
$body.html(content);