Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,9 @@
* Use the JavaScript reference implementation, not the Lua one
to generate expected output in syntax.html.

* Specify punctuation handling for auto-generated heading IDs:
each maximal run of non-alphanumeric ASCII characters is
replaced with `-`, and leading/trailing `-` are trimmed. This
settles remove-vs-replace as replace and removes the previous
exceptions for individual punctuation characters (#391).

7 changes: 4 additions & 3 deletions doc/syntax.html
Original file line number Diff line number Diff line change
Expand Up @@ -1753,9 +1753,10 @@ <h3>Links to headings</h3>
do not have explicit identifiers attached to them.
The identifier is formed by taking the plain text content of
the heading, excluding non-textual elements such as footnote
references and symbols, removing punctuation (other than <code>_</code>
and <code>-</code>), replacing spaces with <code>-</code>, and if necessary for
uniqueness, adding a numerical suffix.</p>
references and symbols, replacing each maximal run of
non-alphanumeric ASCII characters with <code>-</code>, removing any
leading or trailing <code>-</code>, and if necessary for uniqueness,
adding a numerical suffix.</p>
<p>For example, <code># Introduction[^1]</code> generates the identifier
<code>Introduction</code>, not <code>Introduction1</code>.</p>
<div class="example">
Expand Down
7 changes: 4 additions & 3 deletions doc/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -765,9 +765,10 @@ Identifiers are added automatically to any headings that
do not have explicit identifiers attached to them.
The identifier is formed by taking the plain text content of
the heading, excluding non-textual elements such as footnote
references and symbols, removing punctuation (other than `_`
and `-`), replacing spaces with `-`, and if necessary for
uniqueness, adding a numerical suffix.
references and symbols, replacing each maximal run of
non-alphanumeric ASCII characters with `-`, removing any
leading or trailing `-`, and if necessary for uniqueness,
adding a numerical suffix.

For example, `# Introduction[^1]` generates the identifier
`Introduction`, not `Introduction1`.
Expand Down