Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

“special characters” should be allowed for anchors. #3307

Open
tastytea opened this issue May 20, 2019 · 4 comments
Open

“special characters” should be allowed for anchors. #3307

tastytea opened this issue May 20, 2019 · 4 comments

Comments

@tastytea
Copy link

% asciidoctor --version
Asciidoctor 2.0.9 [https://asciidoctor.org]
Runtime Environment (ruby 2.4.5p335 (2018-10-18 revision 65137) [x86_64-linux]) (lc:UTF-8 fs:UTF-8 in:UTF-8 ex:UTF-8)

The following document does not convert to the expected HTML5 output.

= Test

anchor:CO₂[]abc

I used the command asciidoctor --backend=html5 --out-file=out.html in.adoc.

According to the W3C Recommendation, the id attribute has to conform only to these rules:

  • Must contain at least one character.
  • Must not contain any space characters.

There are no other restrictions on what form an ID can take; in particular, IDs can consist of just digits, start with a digit, start with an underscore, consist of just punctuation, etc.

But the output is:

<div class="paragraph">
<p>anchor:CO₂[]abc</p>
</div>

I have similar results with &, %, /, and anchors starting with a digit. Please allow “special characters” in anchors.

@cirosantilli
Copy link

Related: #1540

@mojavelinux
Copy link
Member

According to the W3C Recommendation, the id attribute has to conform only to these rules:

Yes, but HTML isn't the only output format for AsciiDoc. Using other characters would lead to invalid DocBook (and likely EPUB 3 too, which still conforms to XML rules in some versions and readers).

@cirosantilli
Copy link

One possible solution would be to let it work fine on HTML5 output, but blow up on other outputs.

@mojavelinux
Copy link
Member

Right. Agreed. I just wanted to make sure to frame the conversation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants