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

Vanish tag #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Vanish tag #49

wants to merge 1 commit into from

Conversation

felipeochoa
Copy link
Owner

@felipeochoa felipeochoa commented Sep 28, 2017

Especially with React 16, it would be nice to have a single command to unwrap the children of a tag and splice them into the surroundings:

let c = <Parent><Child/><Parent>; // point on Parent

after vanishing parent should give:

let c = <Child/>; // point right before Child
  • Initial implementation
  • Clean up whitespace outside the removed tag (e.g., extra newlines)
  • Clean up whitespace when first/last child are text nodes
  • Fix indentation for children
  • If only child is text, wrap it in quotes
  • Set point and mark to the start/end of the child region (or reversed if point was on the closer)
  • Add tests

Need to figure out how to clean up whitespace around tag and add tests
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.

1 participant