JSFiddle - React, Tailwind, and code Playground

HTML

<div id="el"></div>

JavaScript

$('#el').html('ex&shy;am&shy;ple');
alert($('#el').html().replace(/\u00AD/g, '&shy;'));