Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve code point parsing #68

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Improve code point parsing #68

wants to merge 2 commits into from

Conversation

Hammie
Copy link

@Hammie Hammie commented Oct 30, 2019

Improve code point parsing to support unicode literals as value

Also throws a validation error when the codepoint could not be parsed

See issues #54 #56

Also throws a validation error when the codepoint could not be parsed
return value.match(/^((0x[\d[a-f]+)|(\d+))$/gi)
}

function parseCodePoint(codePoint, propName) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is possible to consider parse value which ise recived from json outpu like '\f101' ?
Or maybe is possible to get json for icon-font-generator with js unicode like "\uf101' ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the code to support CSS unicode escape codes. I think this should do what you ask for.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Hammie really thank You for that. This is exactly what i wont.

return value.match(/^((0x[\d[a-f]+)|(\d+))$/gi)
}

function parseCodePoint(codePoint, propName) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Hammie really thank You for that. This is exactly what i wont.

Copy link

@jimmyandrade jimmyandrade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants