Last change
on this file since ceaed42 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
610 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
3 | const { detachNodeFromParent } = require('../lib/xast.js');
|
---|
4 |
|
---|
5 | exports.name = 'removeXMLProcInst';
|
---|
6 | exports.type = 'visitor';
|
---|
7 | exports.active = true;
|
---|
8 | exports.description = 'removes XML processing instructions';
|
---|
9 |
|
---|
10 | /**
|
---|
11 | * Remove XML Processing Instruction.
|
---|
12 | *
|
---|
13 | * @example
|
---|
14 | * <?xml version="1.0" encoding="utf-8"?>
|
---|
15 | *
|
---|
16 | * @author Kir Belevich
|
---|
17 | *
|
---|
18 | * @type {import('../lib/types').Plugin<void>}
|
---|
19 | */
|
---|
20 | exports.fn = () => {
|
---|
21 | return {
|
---|
22 | instruction: {
|
---|
23 | enter: (node, parentNode) => {
|
---|
24 | if (node.name === 'xml') {
|
---|
25 | detachNodeFromParent(node, parentNode);
|
---|
26 | }
|
---|
27 | },
|
---|
28 | },
|
---|
29 | };
|
---|
30 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.