Created
December 25, 2020 22:47
-
-
Save evan-brass/404720a9fe2fff8aa9e89413a6f9c58d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Parse an open tag | |
const success = pull(/^<([a-zA-Z][a-zA-Z0-9\-]*)/, tag => { | |
const new_tag = { tag, attributes: {}, children: [] }; | |
cursor.children.push(new_tag); | |
parse_attributes(new_tag); | |
if (!VOID_TAGS.includes(tag.toLowerCase())) { | |
parse_content(new_tag); | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment