Created
December 25, 2020 22:29
-
-
Save evan-brass/06af0dafa2e41c68a38eb05ee15bb165 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
function parse_attributes(cursor) { | |
while(pull(/^\s+([a-zA-Z][a-zA-Z0-9\-]+)="([^"]*)"/, ( | |
name, | |
value | |
) => { | |
cursor.attributes[name] = value; | |
})) {} | |
if (!pull(/^\s*>/)) { | |
throw new Error("Malformed open tag"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment