question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: remove tag but keep contents

See original GitHub issue

Hi,

Would there be any interest in a feature which removes a tag but retains it’s contents?

This could be useful for situations where to prevent bad formatting all the div elements are removed whilst retaining the contents. For example; <div><div>some text <a href="somewebsite">link here</a></div><div>more text</div></div> the above would become this: some text <a href="somewebsite">link here</a> more text

Let me know if this is of interest and I can generate a pull request.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ghostcommented, Mar 16, 2022

Happy to help, as the pull request has been accepted I’m closing this feature request 🎉

0reactions
DiemenDesigncommented, Mar 16, 2022

Thanks for all your help everyone, with moving house recently, life has gotten in the way. Thanks @RichardSquires for the improvements and nice additions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Remove a HTML tag but keep the innerHtml - Stack Overflow
The first line copies the HTML contents of the b tag to the location directly after the b tag, and then the second...
Read more >
Leave text content? · Issue #15 · cure53/DOMPurify - GitHub
@cure53 I've been presented with this problem in a SO question where the user wanted to remove anchor elements, but keeping their text...
Read more >
Edit or remove product tags and features from Instagram
Remove product tags or features from your post · Go to the post with the product tag or feature that you want to...
Read more >
Solved: Remove HTML Tags - ServiceNow Community
I have 2 tags in my HTML field, <p> and <a>. I want to keep the <a> tag so that it maintains the...
Read more >
Remove Formatting leave html tags on text
When I select all of the text (for example in the Description field) and remove formatting, it does not remove all of the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found