STRING::STRIP_HTML_TAGS
1g 2023-11-22 laplante@plcb.ca GOWEB/STRING — Remove HTML Tags from Stringtitle: “STRING::STRIP_HTML_TAGS” version: “1.0.0” date: 2023-11-22 author: “laplante@plcb.ca” section: “1g” category: “GOWEB/STRING”
string::strip_html_tags Remove HTML Tags from String
string::strip_html_tags(string[, string... , keeptags: bool, tags: [string,...]])
strip_html_tags(string[, string... , keeptags: bool, tags: [string,...]])
string::stripHtmlTags(string[, string... , keeptags: bool, tags: [string,...]])
stripHtmlTags(string[, string... , keeptags: bool, tags: [string,...]])
The strip_html_tags
function removes HTML tags from a string.
By default, all tags are removed unless a list of tags is provided in the tags
parameter.
keeptags
— If true
, keeps only the tags listed in tags
.
If false
, removes only the tags listed in tags
.res={{
str := "<html><body><p>allo</p></body></html>";
strip_html_tags(str, keeptags:true, tags:["p","/p"]); "\n";
strip_html_tags(str, keeptags:false, tags:["p","/p"]);
}}.
Returns:
<p>allo</p>
<html><body>allo</body></html>
laplante@plcb.ca