Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. <script language="javascript">
  2. $("div.post-content , .parsedsig").each(function(){
  3. if($(this).html().indexOf("[/tabulaScriptum]") != -1) {
  4. pattern = /[tabulaScriptum=(.*?)]([^[]*)[/tabulaScriptum]/gi
  5. $(this).html($(this).html().replace(pattern, "<div class='tabulaScriptum'><div class='tabulaNomen'>$1</div><div class='tabulaImpleo'>$2</div></div>"))
  6. }
  7. });
  8. </script>
  9.  
  10. $("div.post-content .code-box .tabulaScriptum").each(function () {
  11. var $this = $(this);
  12. $this.before('[tabulaScriptum=]' + $this.text() + '[/tabulascriptum]');
  13. $this.remove();
  14. });
  15.  
  16. // Temporarily render .code-box contained tabulas unrecognizable
  17. $('.code-box').each(function () {
  18. var pattern = /[tabula/gi;
  19. $(this).html($(this).html().replace(pattern, "[placeholder"));
  20. });
  21.  
  22. // Search / Replace, as before...
  23.  
  24. // Restore .code-box contained tabulas
  25. $('.code-box').each(function () {
  26. var pattern = /[placeholder/gi;
  27. $(this).html($(this).html().replace(pattern, "[tabula"));
  28. });​
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement