JSFiddle - React, Tailwind, and code Playground
HTML
This is my text.
- <large>Large Text</large> -
Other Text
JavaScript
rewrites = {
large: '<span style="font-size: 2em">{}</span>'
};
function rewrite(r) {
for (rule in r) {
$(rule).each(function (i, el) {
var inner = $(this).html();
var templated = r[rule].replace("{}", inner);
$(this).replaceWith(templated);
});
}
}
rewrite(rewrites);