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

Adding ability to parse an abbreviation and then expanding it. #22

Merged
merged 1 commit into from
Feb 14, 2018

Conversation

gushuro
Copy link
Contributor

@gushuro gushuro commented Feb 14, 2018

The emmetio/expand-abbreviation module allows to parse an abbreviation and get a tree structure out of it, which can later be passed as argument to the expand method.

Adding the ability to do this when using the emmet-helper.

@ramya-rao-a ramya-rao-a merged commit d12e615 into microsoft:master Feb 14, 2018
@@ -626,17 +626,20 @@ function applyVendorPrefixes(expandedProperty: string, vendors: string, preferen
return prefixedProperty + expandedProperty;
}

export function parseAbbreviation(abbreviation: string, options: ExpandOptions): any {
return parse(abbreviation, options);
}

/**
* Expands given abbreviation using given options
* @param abbreviation string
Copy link
Contributor

Choose a reason for hiding this comment

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

this needs to be adjusted, doesn't it?

Copy link
Contributor

Choose a reason for hiding this comment

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

you mean formatted?

Copy link
Contributor

Choose a reason for hiding this comment

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

No, the type isn't string anymore.

Copy link
Contributor Author

@gushuro gushuro Feb 15, 2018

Choose a reason for hiding this comment

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

Edit: I was looking at the wrong place. You're right, we set the parameter to any and line 635 should reflect that.

The parse function in the expand module is expecting an abbreviation of type string.
The idea is that, having an abbreviation that is a string, you can either:

  • Expand it as usual, or
  • Parse it into a tree structure with this method, then read/modify it, and finally expand it

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