-/* $Id: html.c,v 1.269 2020/04/19 15:16:56 schwarze Exp $ */
+/* $Id: html.c,v 1.270 2020/04/20 13:07:24 schwarze Exp $ */
/*
* Copyright (c) 2011-2015, 2017-2020 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* permitted in URL-fragment strings according to the
* explicit list at:
* https://url.spec.whatwg.org/#url-fragment-string
+ * In addition, reserve '~' for ordinal suffixes.
*/
for (cp = buf; *cp != '\0'; cp++)
if (isalnum((unsigned char)*cp) == 0 &&
- strchr("!$&'()*+,-./:;=?@_~", *cp) == NULL)
+ strchr("!$&'()*+,-./:;=?@_", *cp) == NULL)
*cp = '_';
if (unique == 0)
if (entry->ord > 1) {
cp = buf;
- mandoc_asprintf(&buf, "%s_%d", cp, entry->ord);
+ mandoc_asprintf(&buf, "%s~%d", cp, entry->ord);
free(cp);
}
return buf;
text
</pre>
<dl class="Bl-tag">
- <dt id="tag_2"><a class="permalink" href="#tag_2">tag</a></dt>
+ <dt id="tag~2"><a class="permalink" href="#tag~2">tag</a></dt>
<dd>
<pre>
indented
text
</pre>
<dl class="Bl-tag">
- <dt id="tag_3"><a class="permalink" href="#tag_3">tag</a></dt>
+ <dt id="tag~3"><a class="permalink" href="#tag~3">tag</a></dt>
<dd>
<pre>
indented
out of indented paragraph</a></h2>
<p class="Pp">regular text</p>
<dl class="Bl-tag">
- <dt id="tag_4"><a class="permalink" href="#tag_4">tag</a></dt>
+ <dt id="tag~4"><a class="permalink" href="#tag~4">tag</a></dt>
<dd>indented regular text
<pre>
indented
<dl class="Bl-tag">
<dt id="tag"><a class="permalink" href="#tag">tag</a></dt>
<dd>text</dd>
- <dt id="tag_2"><a class="permalink" href="#tag_2">tag</a></dt>
+ <dt id="tag~2"><a class="permalink" href="#tag~2">tag</a></dt>
<dd>text</dd>
</dl>
outer text</div>
regular text
<div class="Bd Pp
- Bd-indent" id="outer_2"><a class="permalink" href="#outer_2">outer</a> text
+ Bd-indent" id="outer~2"><a class="permalink" href="#outer~2">outer</a> text
(4n)
<div class="Bd Pp
- Bd-indent" id="inner_2"><a class="permalink" href="#inner_2">inner</a> text
+ Bd-indent" id="inner~2"><a class="permalink" href="#inner~2">inner</a> text
(2n)</div>
outer text
<dl class="Bl-tag">
</section>
</section>
<section class="Sh">
-<h1 class="Sh" id="DESCRIPTION_2"><a class="permalink" href="#DESCRIPTION_2">DESCRIPTION</a></h1>
+<h1 class="Sh" id="DESCRIPTION~2"><a class="permalink" href="#DESCRIPTION~2">DESCRIPTION</a></h1>
<p class="Pp">Text in duplicate description section.</p>
</section>
<section class="Sh">