This library replaces SVG <text style="text-decoration: underline;">
to <rect>
underline.
It's useful when you try to convert SVG to PDF texts with underline by programs like Inkscape, CairoSVG and so on.
It replaces only simple text without any transformation and with no multiple tspan.
Include in header:
<script src="svgUnderline.js"></script>
var texts = document.querySelectorAll('svg text');
svgUnderline.replaceAll(texts);
var texts = document.querySelector('svg text');
svgUnderline.replace(text);
Code is inspired by underlineJS