sbarex / QLMarkdown

macOS Quick Look extension for Markdown files.
GNU General Public License v3.0
1.31k stars 33 forks source link

TOC links containing the letter İ do not work. #138

Closed setanarut closed 1 month ago

setanarut commented 1 month ago

TOC links containing the letter İ do not work. Clicking on links containing the Turkish character İ does not jump to the relevant title. VSCode Markdown All in One Extension and GitHub site do not have this problem.

Click on the İnsan or Deneme İşte İnek link in the file below. It does not jump.

test.md

sbarex commented 1 month ago

The Deneme İşte İnek will be converted to the anchor deneme-işte-inek. Is the lowercase conversion correct?

setanarut commented 1 month ago

Yes. Here are the HTML files I saved with VScode and QLMarkdown. The QLMarkdown one doesn't work.-> qlmarkdown-vscode.zip

My settings. Heads anchor is selected.

Ekran Resmi 2024-08-11 17 50 49

sbarex commented 1 month ago

In the application settings you have enabled the extension heads anchor?

Screenshot 2024-08-11 alle 16 45 41

The extension insert an anchor for every heads on the md file. The anchor is created from the title, set to lowercase, with non-letter symbols removed, and spaces replaced with dashes.

The question is how the letter İ should be converted into lowercase. My code translate it to a normal i accord to unicode rule, and also wikipedia. But some other software adopt the .

setanarut commented 1 month ago

selected yes. I just sent an incorrect reply and deleted it. We can compare the codes in the zip file I sent and find the problem. I couldn't find it. qlmarkdown-vscode.zip

sbarex commented 1 month ago

The problem is that in your toc you have the link to #i̇nsan (with double dot over the i), but the generated anchor title is #insan (with a plain latin i)

setanarut commented 1 month ago

The problem is that in your toc you have the link to #i̇nsan (with double dot over the i), but the generated anchor title is #insan (with a plain latin i)

I can't see any difference between the two. Why is vscode.html working properly?

Ekran Resmi 2024-08-11 18 27 11

sbarex commented 1 month ago

In your vcode.html the head id is i̇nsan (note the i with the double dot) so the anchor in the TOC works. In your screenshot is not visible the double dot (font problem? or you font missing some unicode glyphs?)

Screenshot 2024-08-11 alle 19 38 58
setanarut commented 1 month ago

In your vcode.html the head id is i̇nsan (note the i with the double dot) so the anchor in the TOC works. In your screenshot is not visible the double dot (font problem? or you font missing some unicode glyphs?)

Ahh thanks. I was able to see it when I changed the font to Menlo. Then this is a bug related to QLMarkdown.

sbarex commented 1 month ago

I'm not sure if it's a qlmarkdown bug. As said before the lover case of İ is a plain latin i (see unicode and wiki rules). Also I use the standard cpp to translate a widestring to lowercase.

setanarut commented 1 month ago

Yes but this is not i character -> <li><a href="#i%CC%87nsan">İnsan</a></li>

it should convert it like this. it doesn't work because there are two different letters. <li><a href="#insan">İnsan</a></li>

setanarut commented 1 month ago

Encodings for URL. QLMarkdown is not matching properly.

İ %C4%B0
i%CC%87