JSFiddle - React, Tailwind, and code Playground

HTML

<blockquote>
 <div>Stuff
  <span>
   <b>Things</b>
   <h2>Stuff</h2>
   <h3>Other</h3>
   <h4>Grassy</h4>
   <p>Not this</p>
   <h5>More replace</h5>
  </span>
 </div>
</blockquote>
<b>Outside of the blockquote</b>
<h1>Should not be affected</h1>
<h2>Should not be affected either</h2>

CSS

h6 {
    color: red;
    background-color: #eee;
}

JavaScript

$("blockquote b,h2,h3,h4,h5").each(function () {
    var that = $(this);
    var contents = that.html();
    that.replaceWith("<h6>" + contents + "</h6>");
});