JSFiddle - React, Tailwind, and code Playground

HTML

<div><div data-id="1916"><div class="highlightStart">highlightStart</div></div></div>
<div>Outside<div>Content to Highlight</div>More</div>
<div>second</div>
<div>third</div>
<div><div data-id="1917"><div class="highlightEnd">highlightEnd</div></div></div>

CSS

section.highlight {
    border: 1px solid green;
    background-color: #eee;
}

JavaScript

$(document).ready(function () {
   $('.highlightStart').parent().parent().replaceWith("<div class='highlightStart'>");
   $('.highlightEnd').parent().parent().replaceWith("<div class='highlightEnd'>");
    $('.highlightStart').nextUntil('.highlightEnd').andSelf().wrapAll("<section class='highlight'>");

   $('.highlightStart, .highlightEnd').remove();
});