Skip to content

Commit

Permalink
Relaxed anchor ID name syntax (see http://groups.google.com/group/asc…
Browse files Browse the repository at this point in the history
  • Loading branch information
Stuart Rackham committed Aug 11, 2010
1 parent b498e34 commit 4ceeb32
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.txt
Expand Up @@ -6,6 +6,8 @@ AsciiDoc ChangeLog
Version 8.5.4 (2010-08-15)
--------------------------
.Additions and changes
- Relaxed anchor ID name syntax
(http://groups.google.com/group/asciidoc/browse_thread/thread/5f3e825c74ed30c).
- Added document files: `doc/epub-notes.txt`,
`doc/publishing-ebooks-with-asciidoc.txt`.
- 'a2x': If all other resource locations are exhausted then recursively
Expand Down
6 changes: 3 additions & 3 deletions asciidoc.conf
Expand Up @@ -194,11 +194,11 @@ CAUTION-style=template="admonitionparagraph",name="caution",caption="{caution-ca
(?su)[\\]?(?P<name>footnote|footnoteref):(?P<target>\S*?)\[(?P<attrlist>.*?)\]=

# Anchor: [[[id]]]. Bibliographic anchor.
(?su)[\\]?\[\[\[(?P<attrlist>[\w][\w-]*?)\]\]\]=anchor3
(?su)[\\]?\[\[\[(?P<attrlist>[\w_:][\w_:.-]*?)\]\]\]=anchor3
# Anchor: [[id,xreflabel]]
(?su)[\\]?\[\[(?P<attrlist>[\w"].*?)\]\]=anchor2
(?su)[\\]?\[\[(?P<attrlist>[\w"_:].*?)\]\]=anchor2
# Link: <<id,text>>
(?su)[\\]?&lt;&lt;(?P<attrlist>[\w"].*?)&gt;&gt;=xref2
(?su)[\\]?&lt;&lt;(?P<attrlist>[\w"_:].*?)&gt;&gt;=xref2

ifdef::asciidoc7compatible[]
# Index term: ++primary,secondary,tertiary++
Expand Down
9 changes: 5 additions & 4 deletions doc/asciidoc.txt
Expand Up @@ -2091,10 +2091,11 @@ Used to specify hypertext link targets:
[[<id>,<xreflabel>]]
anchor:<id>[<xreflabel>]

The `<id>` is a unique identifier that must begin with a letter. The
optional `<xreflabel>` is the text to be displayed by captionless
'xref' macros that refer to this anchor. The optional `<xreflabel>` is
only really useful when generating DocBook output. Example anchor:
The `<id>` is a unique string that conforms to the output markup's
anchor syntax. The optional `<xreflabel>` is the text to be displayed
by captionless 'xref' macros that refer to this anchor. The optional
`<xreflabel>` is only really useful when generating DocBook output.
Example anchor:

[[X1]]

Expand Down
5 changes: 5 additions & 0 deletions tests/data/testcases.txt
Expand Up @@ -155,6 +155,11 @@ An [[X3, anchor reftext]] inline anchor with reftext.

Link to <<X3>> anchor.

An example link to a bibliography entry <<Test::Unit>>.

[horizontal]
[[[Test::Unit]]]:: http://ruby-doc.org/stdlib/libdoc/test/unit/rdoc/classes/Test/Unit.html


== Titles ==

Expand Down

0 comments on commit 4ceeb32

Please sign in to comment.