Function: remove_tag

Function: remove_tag


 remove_tag(tag: some_tag, some_string)

Remove a tag and its matching close tag from a tagged string, but keep the contents.

The tag can be a whole tag, "<tag>", or a prefix "<i". In the latter case all tags starting with "<i" are removed.


Parameter Type Description
tag string Tag to remove
input tagged string String to remove tags from


 remove_tag(tag: "<b>", "<b>bold <i>text</i></b>")  ==  "bold <i>text</i>"
 remove_tag(tag: "<b", "<b-auto>bold</b-auto> text")  ==  "bold text"

 f := remove_tag@(tag: "<i-auto>")
 f("text, <i-auto>reminder</i-auto> <i>italic</i>") == "text, reminder <i>italic</i>"

See also

tag_contents Change the contents of a specific tag.
remove_tags Remove all tags from tagged text.
to_text Remove all tags from tagged text, and convert it to a string.