source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mandoc: prevent breakable hyphens in segment identifiers  from being
@ 2022-08-09 11:23 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2022-08-09 11:23 UTC (permalink / raw)
  To: source

Log Message:
-----------
prevent breakable hyphens in segment identifiers 
from being turned into underscores;
bug reported by <Eldred dot fr> Habert

Modified Files:
--------------
    mandoc:
        html.c

Revision Data
-------------
Index: html.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/html.c,v
retrieving revision 1.278
retrieving revision 1.279
diff -Lhtml.c -Lhtml.c -u -p -r1.278 -r1.279
--- html.c
+++ html.c
@@ -403,10 +403,13 @@ html_make_id(const struct roff_node *n, 
 	 * In addition, reserve '~' for ordinal suffixes.
 	 */
 
-	for (cp = buf; *cp != '\0'; cp++)
-		if (isalnum((unsigned char)*cp) == 0 &&
+	for (cp = buf; *cp != '\0'; cp++) {
+		if (*cp == ASCII_HYPH)
+			*cp = '-';
+		else if (isalnum((unsigned char)*cp) == 0 &&
 		    strchr("!$&'()*+,-./:;=?@_", *cp) == NULL)
 			*cp = '_';
+	}
 
 	if (unique == 0)
 		return buf;
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-09 11:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-09 11:23 mandoc: prevent breakable hyphens in segment identifiers from being schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).