Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script language="javascript">
- $("div.post-content , .parsedsig").each(function(){
- if($(this).html().indexOf("[/tabulaScriptum]") != -1) {
- pattern = /[tabulaScriptum=(.*?)]([^[]*)[/tabulaScriptum]/gi
- $(this).html($(this).html().replace(pattern, "<div class='tabulaScriptum'><div class='tabulaNomen'>$1</div><div class='tabulaImpleo'>$2</div></div>"))
- }
- });
- </script>
- $("div.post-content .code-box .tabulaScriptum").each(function () {
- var $this = $(this);
- $this.before('[tabulaScriptum=]' + $this.text() + '[/tabulascriptum]');
- $this.remove();
- });
- // Temporarily render .code-box contained tabulas unrecognizable
- $('.code-box').each(function () {
- var pattern = /[tabula/gi;
- $(this).html($(this).html().replace(pattern, "[placeholder"));
- });
- // Search / Replace, as before...
- // Restore .code-box contained tabulas
- $('.code-box').each(function () {
- var pattern = /[placeholder/gi;
- $(this).html($(this).html().replace(pattern, "[tabula"));
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement