help / color / mirror / Atom feed
Subject: mandoc: prevent breakable hyphens in segment identifiers  from being
Date: Tue, 9 Aug 2022 06:23:41 -0500 (EST)	[thread overview]
Message-ID: <> (raw)

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

Modified Files:

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

                 reply	other threads:[~2022-08-09 11:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).