File tree Expand file tree Collapse file tree 3 files changed +5
-9
lines changed
Expand file tree Collapse file tree 3 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -521,5 +521,5 @@ export function escapeHtml(unsafe: string): string {
521521 . replace ( / < / g, "<" )
522522 . replace ( / > / g, ">" )
523523 . replace ( / " / g, """ )
524- . replace ( / ' / g, "' ;" )
524+ . replace ( / ' / g, "&apos ;" )
525525}
Original file line number Diff line number Diff line change @@ -437,8 +437,8 @@ describe("onLine", () => {
437437
438438describe ( "escapeHtml" , ( ) => {
439439 it ( "should escape HTML" , ( ) => {
440- expect ( util . escapeHtml ( `<div class="error">"Hello & world"</div>` ) ) . toBe (
441- "<div class="error">"Hello & world"</div>" ,
440+ expect ( util . escapeHtml ( `<div class="error">"'ello & world"</div>` ) ) . toBe (
441+ "<div class="error">"'ello & world"</div>" ,
442442 )
443443 } )
444444} )
Original file line number Diff line number Diff line change @@ -60,18 +60,14 @@ describe("login", () => {
6060 process . env . PASSWORD = previousEnvPassword
6161 } )
6262
63- it ( "should return escaped HTML with 'Missing password' message" , async ( ) => {
63+ it ( "should return HTML with 'Missing password' message" , async ( ) => {
6464 const resp = await codeServer ( ) . fetch ( "/login" , { method : "POST" } )
6565
6666 expect ( resp . status ) . toBe ( 200 )
6767
6868 const htmlContent = await resp . text ( )
6969
70- expect ( htmlContent ) . not . toContain ( ">" )
71- expect ( htmlContent ) . not . toContain ( "<" )
72- expect ( htmlContent ) . not . toContain ( '"' )
73- expect ( htmlContent ) . not . toContain ( "'" )
74- expect ( htmlContent ) . toContain ( "<div class="error">Missing password</div>" )
70+ expect ( htmlContent ) . toContain ( "Missing password" )
7571 } )
7672 } )
7773} )
You can’t perform that action at this time.
0 commit comments