(Exported) PDF Link with toc with À in it does not work


#1

Bug report

(Exported) PDF Link with toc with À in it does not work. And when clicking link in preview window a weird error happens, another note render window is opened at the bottom of the window. Very glitchy.

Info

  • Platform: Windows 8.1
  • Platform version: Latest
  • App Version: Latest

Reproduce

Use the toc plugin. Create a link using ### containing the symbol À in it. Watch the glitch when clicking the link and that when exported it does not work.


(Takuya Matsuyama) #2

Hi Sceptic,

Thank you for the report.
It seems that PDF does not support links with non-latin words including Japanese characters like あ.
I’m afraid that it is by design.

The app converts HTML into PDF with Electron’s API.
Link anchors are generated based on GitHub-style slugs.
But slugs with non-latin characters do not work in PDF files even if they are URL-encoded.


#3

Hi Takuya,

That is weird because I have never had that problem. Links with special characters should work just fine in PDF proof:
removed

There is still the glitchy behavior I tried to explain that happens inside Inkdrop after clicking a link with À in it:
removed

Note that note renderer window did not open this time I could not reproduce that today only a weird margin is added at the bottom. Still glitchy though. Could not find out with dev tools what happened.


(Takuya Matsuyama) #4

Do you use the latest version of TOC plugin?
There was the same issue in the past but resolved.

I guess that’s because special characters are not used in the anchors in your pdf file. I’m not talking about link titles.


#5

Aah I see. I personally would not bother with fixing the PDF anchors but it does seem like a small fix.

I was one version behind, and it is fixed now after updating. Thanks!


(Takuya Matsuyama) #6

I have to hack remark-toc and its dependencies to solve the issue.
Seems like easy but would take some time.
I would like to focus on rebuilding the app for now.
Please poke me again once it’s out!

Good to hear that. Thanks again :slight_smile:


(Peilun Ma) #7

I would like to see this issue fixed in the near future because I write notes in Japanese a lot.
Some of my notes are lengthy minutes for business discussions and shared with PDF format.

As Takuya said, this is a specification of PDF that only accept ascii as effective anchor codes.
However, I found this fix that it encodes all toc items to generate unique ids for anchors.

Fix coded by Ruby

Hope this will help.


(Takuya Matsuyama) #8

I understand your need.
I know why it won’t work, that is, non-alphanumerical characters are being URL-encoded (e.g., %38%6F) so it would be nice to just drop % in anchor IDs.
But let me focus on developing the new version for now.