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

  1. -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