Created
February 4, 2021 20:21
-
-
Save baweaver/2f6e1e80cbe667fab9bd67b4c043853d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Pattern to match a link: <a/> | |
node in { name: 'a' } | |
# Pattern for a link with a class: <a class="foo"/> | |
node in { name: 'a', class: 'foo' } | |
# Pattern to select that link: <a class="foo">{.}</a> | |
node => { name: 'a', class: 'foo', children: } | |
# Pattern to select the target URL: <a class="foo" href="{.}"/> | |
node => { name: 'a', href: } | |
# Pattern for multiple links: <a class="foo" href="{.}"/>+ | |
nodes => [*, { name: 'a', href: => link_one }, { name: 'a', href: => link_two } *] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment