title: use Javascript to wrap all regmarks with <sup> tags unless they already have <sup> tags
body: <p>thanks in advance. </p>
  
  <p>I am using </p>
  
  <pre><code>  $(document).ready(function() {
             $("body").html(
      $("body").html().replace(/&amp;reg;/gi, '&lt;sup&gt;&amp;reg;&lt;/sup&gt;').replace(/®/gi, '&lt;sup&gt;&amp;reg;&lt;/sup&gt;')
     );
          });
  </code></pre>
  
  <p>to add a subscript around regmarks, but if the &reg; marks already has the &lt; sup >   &lt; / up > tags, it is adding the superscript twice. Can anyone help me with add a check to stop if its already there?</p>
  
  <p>update::
  I ended up using this code because the answers below were interfering with the rest of my javascript.</p>
  
  <pre><code> $(document).ready(function() {
     $("p,h1,h2,h3,h4, td").each(function(){
       $(this).html($(this).html().replace(/&amp;reg;/gi, '&lt;sup&gt;&amp;reg;&lt;/sup&gt;').replace(/®/gi, '&lt;sup&gt;&amp;reg;       
        &lt;/sup&gt;').replace('&lt;sup&gt;&lt;sup&gt;', '&lt;sup&gt;').replace('&lt;/sup&gt;&lt;/sup&gt;', '&lt;/sup&gt;'));
     });
   });
  </code></pre>