You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Drop __all__ the [*emphasis*][1] and **bold** highlighting, leaving
55
+
Drop __all__ the [*emphasis*][1] and **[bold][1]** highlighting, leaving
38
56
39
57
|_everything_|
40
58
| :----------: |
@@ -45,12 +63,12 @@ Drop __all__ the [*emphasis*][1] and **bold** highlighting, leaving
45
63
[1]: https://ddg.gg/?q=emphasis
46
64
```
47
65
48
-
into this:
66
+
output:
49
67
50
68
```md
51
69
# Drop highlight
52
70
53
-
Drop all the [emphasis][1] and bold highlighting, leaving
71
+
Drop all the [emphasis][1] and [bold][1] highlighting, leaving
54
72
55
73
| everything |
56
74
| :--------: |
@@ -59,21 +77,22 @@ Drop all the [emphasis][1] and bold highlighting, leaving
59
77
## intact
60
78
61
79
[1]: https://ddg.gg/?q=emphasis
62
-
63
80
```
64
81
65
82
## API
66
83
67
84
#### `parents(ast) -> wrappedAst`
68
85
69
-
Wraps AST with a proxy that imposes two additional properties on all nodes:
86
+
Wraps AST with a proxy that imposes two additional properties on all of its nodes:
70
87
71
88
-`parent` — parent link, `null` for the root node.
72
-
-`node` — link to the original AST node, e.g. for adding or changing attributes.
89
+
-`node` — link to the original AST node.
73
90
74
91
None of these properties are enumerable, and the original AST is _not changed_. This means you can JSON.stringify the wrapped tree and it is just the same.
75
92
76
-
Remember to access `.node` before you commit any changes to a node, including its `children` array.
93
+
`wrappedAst.children` returns array of wrapped child nodes, so that any recursive algorithm will work on a wrapped tree just as well.
94
+
95
+
Remember to access `.node` before you commit any changes to a node.
0 commit comments