- 
                Notifications
    You must be signed in to change notification settings 
- Fork 0
removeHTMLentities
        Mike Byrne edited this page Mar 14, 2023 
        ·
        1 revision
      
    Introduced 3.1.0
Removes or replaces HTML entities from a string
- nothing
- str - required - string to remove HTML entities from
- replaceMode - optional - boolean - defaults to false - switch to replace mode from remove mode
- string minus non printable characters
let str = removeHTMLentities(`<div><img src="/foo/bar.jpg" /></div>`); // 'divimg src=/foo/bar.jpg //div'With replaceMode set to true:
let str = removeHTMLentities(`<div><img src="/foo/bar.jpg" /></div>`, true); // '<div><img src="/foo/bar.jpg" /></div>'