diff options
| author | Shulhan <ms@kilabit.info> | 2021-12-06 17:28:04 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2021-12-06 17:28:04 +0700 |
| commit | d0ebdcaeaa5c52b7ff8513d1a324607e104ead3c (patch) | |
| tree | eedfa8deee5f33218569fddc913924652dbdb09e | |
| parent | 674f4d404ec30d363433b72b1c6fd5ffe8a4d1b6 (diff) | |
| download | asciidoctor-go-d0ebdcaeaa5c52b7ff8513d1a324607e104ead3c.tar.xz | |
all: allow colon ':' and period '.' on the ID
According to XML spec [1], the colon is allowed as the first and the next
character. While period is only allowed on the next characters.
[1] https://www.w3.org/TR/REC-xml/#NT-Name
| -rw-r--r-- | parser.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -497,13 +497,13 @@ func isTitle(line []byte) bool { func isValidID(id []byte) bool { for x, r := range string(id) { if x == 0 { - if !(r == '-' || r == '_' || unicode.IsLetter(r)) { + if !(r == ':' || r == '-' || r == '_' || unicode.IsLetter(r)) { return false } continue } - if r == '-' || r == '_' || unicode.IsLetter(r) || - unicode.IsDigit(r) { + if r == ':' || r == '-' || r == '_' || r == '.' || + unicode.IsLetter(r) || unicode.IsDigit(r) { continue } return false |
