0.1.2 • Published 6 years ago
insert-tag v0.1.2
insert-tag
Insert tag to the specific position of a xml/html string:
<a>xxx<b>yyy</b>zzz<a>to
<a>xx<mark>x<b>yy</b></mark><b>y</b>zzz<a>Getting started
Installation
npm install insert-tag --saveUsage
import insertTag from 'insert-tag';
insertTag('<a>xxx<b>yyy</b>zzz<a>', '<mark>', [0, 2, 0, 5]);
// <a>xx<mark>x<b>yy</b></mark><b>y</b>zzz<a>[0, 2, 0, 5] meas from line 0, column 2 to line 0, column 5
For more examples, please see tests
Tests
npm run test