shared
utils
string
object
is
extension
js
tracking
string
dom
when
selection
position
iframe
event
scroll
console
node
string
project
fs
console
tags
Type:Object
Status:stable
Since:1.0.0
Platform:jsnode
@blackbyte.sugar.shared.html
An object of tags to replace which have as value the replacement function that take the tag name, the tag content and must return the replacement content
Return
- -String
The new text
Example
import { replaceTags } from '@blackbyte/sugar/html';
replaceTags('<span>Hello</span> world', {
span: (tag, content) => `<div>${content}</div>`; // => <div>Hello</div> world
});Todo
- testsnormal
Author
- Olivier Bosselolivier.bossel@gmail.comhttps://blackbyte.space