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

Support tag change matching a XPath query (retag(tag)) #292

Open
Kdecherf opened this issue Mar 26, 2022 · 3 comments
Open

Support tag change matching a XPath query (retag(tag)) #292

Kdecherf opened this issue Mar 26, 2022 · 3 comments
Assignees

Comments

@Kdecherf
Copy link
Collaborator

It would be helpful to have the support of a retag(tag): //xpath parameter in site-config files.

The main goal of this command would be to change the tag matching a XPath query.

Example, taking the following html and site-config:

<html>
  <body>
    <div class="heading-h3">Hello world</div>
  </body>
</html>
retag(h3): //div[@class="heading-h3"]

would give the following output:

<html>
  <body>
    <h3>Hello world</h3>
  </body>
</html>
@Kdecherf
Copy link
Collaborator Author

@j0k3r could you assign this issue to me please?

@jtojnar
Copy link
Collaborator

jtojnar commented Mar 26, 2022

Is that an official syntax? Do not see it mentioned in the docs.

And would not it make more sense to preserve the attributes when just changing the tag name?

@Kdecherf
Copy link
Collaborator Author

Is that an official syntax? Do not see it mentioned in the docs.

No, it would be a graby-only command

And would not it make more sense to preserve the attributes when just changing the tag name?

Yes, you're right

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

No branches or pull requests

2 participants