Last change
on this file since 8d391a1 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
566 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | 'use strict';
|
---|
| 2 |
|
---|
| 3 | const { detachNodeFromParent } = require('../lib/xast.js');
|
---|
| 4 |
|
---|
| 5 | exports.name = 'removeMetadata';
|
---|
| 6 | exports.type = 'visitor';
|
---|
| 7 | exports.active = true;
|
---|
| 8 | exports.description = 'removes <metadata>';
|
---|
| 9 |
|
---|
| 10 | /**
|
---|
| 11 | * Remove <metadata>.
|
---|
| 12 | *
|
---|
| 13 | * https://www.w3.org/TR/SVG11/metadata.html
|
---|
| 14 | *
|
---|
| 15 | * @author Kir Belevich
|
---|
| 16 | *
|
---|
| 17 | * @type {import('../lib/types').Plugin<void>}
|
---|
| 18 | */
|
---|
| 19 | exports.fn = () => {
|
---|
| 20 | return {
|
---|
| 21 | element: {
|
---|
| 22 | enter: (node, parentNode) => {
|
---|
| 23 | if (node.name === 'metadata') {
|
---|
| 24 | detachNodeFromParent(node, parentNode);
|
---|
| 25 | }
|
---|
| 26 | },
|
---|
| 27 | },
|
---|
| 28 | };
|
---|
| 29 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.