Adds support to the SVG renderer for target and rel attributes on <a> elements. These two attributes are useful for limiting access to window.opener, for example, or for opening links in new windows/tabs.
When Textbox's HTML parser is used, any rel or target attributes on an <a> element are included in the rendered SVG. For example:
import Textbox from '@borgar/textbox';
const box = new Textbox({ parser: Textbox.htmlparser });
const line = box.render('<a href="https://example.com/" rel="noopener noreferrer nofollow" target="_blank">Hello world</a>');
Adds support to the SVG renderer for
target
andrel
attributes on<a>
elements. These two attributes are useful for limiting access towindow.opener
, for example, or for opening links in new windows/tabs.When Textbox's HTML parser is used, any
rel
ortarget
attributes on an<a>
element are included in the rendered SVG. For example:Will produce:
These two attributes are only supported on
<a>
elements, and only in the SVG renderer.