JSFiddle - React, Tailwind, and code Playground

HTML

text+images part 1
<div class="sep">some text</div>
<p>text+<img src="http://www.gravatar.com/avatar/34f1254852d49f58359da5df2da33f60?s=32&d=identicon&r=PG" alt="Elektronik-Lexikon" /> part2</p>
<div class="sep">some text</div>
text+<img src="http://www.gravatar.com/avatar/47e56e529f0bca9b97b1c5cfc3c87ec6?s=32&d=identicon&r=PG" alt="Elektronik-Lexikon" /> part3
<p>text+<b>images</b> part4</p>

CSS

.text {
    background:green;
    color:white;
    margin:2px;
}
.sep {
    color:red;
}

JavaScript

$("body").prepend('<div class="sep">some text</div>');
$('.sep').each(function(i){
    var $set = $();
    var nxt = this.nextSibling;
    while(nxt) {
        if(!$(nxt).is('.sep')) {
            $set.push(nxt);
            nxt = nxt.nextSibling;
        } else break;
    } 
   $set.wrapAll('<div class="text" id="div_'+i+'"/>');
});
//$(".sep").hide(); // or remove