Skip to content

Commit 14e7033

Browse files
committed
remove space added by function
1 parent 9f4d032 commit 14e7033

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/SanitizeHtml.cfc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,14 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="guard" {
44
describe( title = "Testcase for sanitizeHTML function", body = function() {
55
it( title = "checking sanitizeHTML() function", body = function( currentSpec ) {
66
var html = '<!DOCTYPE html><html><body><h2>HTML Forms</h2><form action="/action_page.cfm"><label for="fname">First name:</label><br><input type="text" id="fname" name="fname"value="Pothys"><br></body></html>';
7+
8+
var res=SanitizeHtml(html);
9+
res=reReplace(res, "\s", "", "all");
10+
expect(res).toBe('<h2>HTML Forms</h2>First name:<br /><br />');
711

8-
expect(SanitizeHtml(html)).toBe('<h2>HTML Forms</h2>First name:<br /><br />');
9-
expect(html.SanitizeHtml()).toBe('<h2>HTML Forms</h2>First name:<br /><br />'); // member function
12+
var res=html.SanitizeHtml();
13+
res=reReplace(res, "\s", "", "all");
14+
expect(res).toBe('<h2>HTML Forms</h2>First name:<br /><br />'); // member function
1015
});
1116
});
1217
}

0 commit comments

Comments
 (0)