Last active
August 29, 2015 13:56
-
-
Save aredridel/9106354 to your computer and use it in GitHub Desktop.
Parsing data URL with ometajs
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
ometa DataUrl { | |
scheme = "data:", | |
type = /[a-z-]+/, | |
charset = /[a-z-]+/, | |
mimeType = type "/" type ( ";charset=" charset )?, | |
charset = | |
dataUrl = scheme mimeType base64? "," data | |
} | |
DataUrl.parse = function (str) { | |
return DataUrl.matchAll(str, 'dataUrl'); | |
}; | |
module.exports = DataUrl; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment