From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id 97b1e984 for ; Mon, 4 Jan 2016 07:45:59 -0500 (EST) Date: Mon, 4 Jan 2016 07:45:59 -0500 (EST) Message-Id: <10610878083455194430.enqueue@fantadrom.bsd.lv> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: schwarze@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: Generate simpler in-page links: just replace spaces with X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- Generate simpler in-page links: just replace spaces with underscores. Patch from bentley@. Modified Files: -------------- mdocml: html.c mdoc_html.c Revision Data ------------- Index: html.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/html.c,v retrieving revision 1.191 retrieving revision 1.192 diff -Lhtml.c -Lhtml.c -u -p -r1.191 -r1.192 --- html.c +++ html.c @@ -720,8 +720,8 @@ void bufcat_id(struct html *h, const char *src) { - /* Cf. . */ + /* Cf. . */ - while ('\0' != *src) - bufcat_fmt(h, "%.2x", *src++); + for (; '\0' != *src; src++) + bufncat(h, *src == ' ' ? "_" : src, 1); } Index: mdoc_html.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/mdoc_html.c,v retrieving revision 1.238 retrieving revision 1.239 diff -Lmdoc_html.c -Lmdoc_html.c -u -p -r1.238 -r1.239 --- mdoc_html.c +++ mdoc_html.c @@ -542,7 +542,6 @@ mdoc_sh_pre(MDOC_ARGS) } bufinit(h); - bufcat(h, "x"); for (n = n->child; n != NULL && n->type == ROFFT_TEXT; ) { bufcat_id(h, n->string); @@ -572,7 +571,6 @@ mdoc_ss_pre(MDOC_ARGS) return 1; bufinit(h); - bufcat(h, "x"); for (n = n->child; n != NULL && n->type == ROFFT_TEXT; ) { bufcat_id(h, n->string); @@ -1063,7 +1061,7 @@ mdoc_sx_pre(MDOC_ARGS) struct htmlpair tag[2]; bufinit(h); - bufcat(h, "#x"); + bufcat(h, "#"); for (n = n->child; n; ) { bufcat_id(h, n->string); -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv