Feature request: remove tag but keep contents
See original GitHub issueHi,
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:
- Created 2 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Happy to help, as the pull request has been accepted I’m closing this feature request 🎉
Thanks for all your help everyone, with moving house recently, life has gotten in the way. Thanks @RichardSquires for the improvements and nice additions.