-
Notifications
You must be signed in to change notification settings - Fork 501
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Items in toc are not clickable if those items contain some CJK characters. #481
Comments
This appears to be the same problem as #308. |
When I click the two unclickable links, I get the following warnings in the console:
|
As you can see, PDF cannot reference internal IDs that contain characters beyond a certain range (I'm not sure what that range is). As I mention in #308, we'll need to generate internal IDs using a different strategy that adheres to the PDF specification. |
Here's the document I'm using for testing:
|
I think the solution is to convert the anchor to hex if a call to In the case of
I decided to prefix the hex value with 0x to distinguish it from an ASCII ID. This change will also squash the following warning:
The regexp in pdf-core assumes it's working with an ASCII string, so we have to be sure to supply it with one. |
…haracters outside ASCII range in hex - fix cross references for IDs that contain characters outside the ASCII range - squelch the following warning: regexp match /.../n against to UTF-8 string
…haracters outside ASCII range in hex - hex encode anchors that contain characters outside the ASCII range - squelch the following warning: regexp match /.../n against to UTF-8 string (pdf-core < 0.6.1)
@mojavelinux Thanks for your effort! By the way, how did you debug the reference issue you mentioned as following?
|
Do you mean how did I test it? |
@mojavelinux Yep. What tool did you give the error message? |
Those error messages come from evince (the PDF viewer in Gnome). |
…haracters outside ASCII range in hex (PR asciidoctor#499) - hex encode anchors that contain characters outside the ASCII range - squelch the following warning: regexp match /.../n against to UTF-8 string (pdf-core < 0.6.1)
I render this test document with the command
asciidoctor-pdf -r asciidoctor-pdf-cjk-kai_gen_gothic -a pdf-style=KaiGenGothicCN test.asc
with the help ofasciidoctor-pdf-cjk
gem package which provides a library for a good theme and font solution.Version info:
test.asc
You can also get my rendered PDF here.
The text was updated successfully, but these errors were encountered: