tech@mandoc.bsd.lv
 help / color / Atom feed
* Double quotes in man.cgi search output
@ 2016-08-30  7:43 Anthony J. Bentley
  2016-09-11 23:57 ` Ingo Schwarze
  0 siblings, 1 reply; 2+ messages in thread
From: Anthony J. Bentley @ 2016-08-30  7:43 UTC (permalink / raw)
  To: tech

Hi,

html_putchar() escapes double quotes incorrectly: the entity should be
", not &quote;.

https://www.w3.org/TR/html5/syntax.html#named-character-references

For example:

http://man.openbsd.org/?query=Nd~%22&apropos=1

In Firefox, each &quote; is rendered as: "e;
because Firefox believes what the author meant to write was "e;

Index: cgi.c
===================================================================
RCS file: /cvs/src/usr.bin/mandoc/cgi.c,v
retrieving revision 1.77
diff -u -p -r1.77 cgi.c
--- cgi.c	18 Aug 2016 00:44:37 -0000	1.77
+++ cgi.c	30 Aug 2016 07:34:28 -0000
@@ -136,7 +136,7 @@ html_putchar(char c)
 
 	switch (c) {
 	case ('"'):
-		printf("&quote;");
+		printf(""");
 		break;
 	case ('&'):
 		printf("&");
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Double quotes in man.cgi search output
  2016-08-30  7:43 Double quotes in man.cgi search output Anthony J. Bentley
@ 2016-09-11 23:57 ` Ingo Schwarze
  0 siblings, 0 replies; 2+ messages in thread
From: Ingo Schwarze @ 2016-09-11 23:57 UTC (permalink / raw)
  To: Anthony J. Bentley; +Cc: tech

Hi Anthony,

Anthony J. Bentley wrote on Tue, Aug 30, 2016 at 01:43:59AM -0600:

> html_putchar() escapes double quotes incorrectly: the entity should be
> ", not &quote;.
> 
> https://www.w3.org/TR/html5/syntax.html#named-character-references
> 
> For example:
> 
> http://man.openbsd.org/?query=Nd~%22&apropos=1
> 
> In Firefox, each &quote; is rendered as: "e;
> because Firefox believes what the author meant to write was "e;

OK schwarze@
  Ingo

> Index: cgi.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/mandoc/cgi.c,v
> retrieving revision 1.77
> diff -u -p -r1.77 cgi.c
> --- cgi.c	18 Aug 2016 00:44:37 -0000	1.77
> +++ cgi.c	30 Aug 2016 07:34:28 -0000
> @@ -136,7 +136,7 @@ html_putchar(char c)
>  
>  	switch (c) {
>  	case ('"'):
> -		printf("&quote;");
> +		printf(""");
>  		break;
>  	case ('&'):
>  		printf("&");
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-30  7:43 Double quotes in man.cgi search output Anthony J. Bentley
2016-09-11 23:57 ` Ingo Schwarze

tech@mandoc.bsd.lv

Archives are clonable: git clone --mirror http://inbox.vuxu.org/mandoc-tech

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.mandoc.tech


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git