File tree Expand file tree Collapse file tree 1 file changed +21
-4
lines changed
Specialized Areas/Flow Actions/Remove HTML Tags from a String in a Flow Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Original file line number Diff line number Diff line change 1- ( function execute ( inputs , outputs ) {
2- var htmlString = inputs . htmlValue || '' ;
3- outputs . plainString = htmlString . replace ( / < [ ^ > ] + > / g, '' ) . trim ( ) ;
4- } ) ( inputs , outputs ) ;
1+ function removeHtmlTags ( value ) {
2+ if ( value === null || value === undefined ) {
3+ return '' ;
4+ }
5+
6+ var stringValue = String ( value ) ;
7+ var withoutTags = stringValue . replace ( / < [ ^ > ] + > / g, ' ' ) ;
8+
9+ return withoutTags . replace ( / \s + / g, ' ' ) . trim ( ) ;
10+ }
11+
12+ if ( typeof module !== 'undefined' ) {
13+ module . exports = removeHtmlTags ;
14+ }
15+
16+ if ( typeof inputs !== 'undefined' && typeof outputs !== 'undefined' ) {
17+ ( function execute ( inputs , outputs ) {
18+ var htmlString = inputs . htmlValue || '' ;
19+ outputs . plainString = removeHtmlTags ( htmlString ) ;
20+ } ) ( inputs , outputs ) ;
21+ }
You can’t perform that action at this time.
0 commit comments