README
trans-style-tags
Transform inline-style of rich-text to tags, Provide for the use of AOS and IOS
Provide
- .min.js
- .cjs.min.js
- .esm.min.js
Introduction
- just support current need attrs
Prepare
...
{
...
"dependencies": {
...
"trans-style-tags",
"html-to-vdom",
...
}
...
}
Usage
import TransStyleTags from 'trans-style-tags';
const html = `
<ul>
<li style="font-weight: bold; font-style: italic; text-decoration: underline;">first</li>
<li>second</li>
<li>third</li>
</ul>
`;
const tst = new TransStyleTags();
const newHtml = tst.parse(_html);
console.log(newHtml);
/**
<ul>
<li><b><i><u>first</u></i></b></li>
<li>second</li>
<li>third</li>
</ul>
*/
Todo
- support all style
Release
0.0.3
- fix single-line html: forEach error
0.0.4
- fix single-line html: forEach error
vTree
is object