Freelink and non-english tiddler title

175 views
Skip to first unread message

keSh

unread,
Sep 8, 2021, 2:31:23 PM9/8/21
to TiddlyWiki
Hi all,

Freelink does not recognize if tiddler title has non-english characters (unicode).
Confirmed to work as described only for english titles. 


TiddlyDesktop version 0.14
TiddlyWiki version 5.1.22

Does anyone have  a workaround for this issue?

thanks

PMario

unread,
Sep 8, 2021, 3:22:21 PM9/8/21
to TiddlyWiki
Hi keSh,

I did have a look at the source code. There is a problem with the regexp, that is used. We will need to create javascript fix
There is no workaround for this problem.

I did test "asdf sdfö" where "asdf" is recognized, but "sdfö" is not.

The plugin uses `\b` to define "word boundaries" but \b in JS only uses: [a-zA-Z0-9_] as word characters. .. That's the problem.

-mario

keSh

unread,
Sep 8, 2021, 3:59:35 PM9/8/21
to TiddlyWiki
Hi Mario.

You may have already seen this discussion on stack overflow. https://stackoverflow.com/a/60188132
I don't know enough javascript to try it out.

thanks again.
-keSh

PMario

unread,
Sep 8, 2021, 4:16:01 PM9/8/21
to TiddlyWiki
On Wednesday, September 8, 2021 at 9:59:35 PM UTC+2 keSh wrote:

You may have already seen this discussion on stack overflow. https://stackoverflow.com/a/60188132
I don't know enough javascript to try it out.

look behind is not supported by safari.

-m

keSh

unread,
Sep 11, 2021, 12:55:18 PM9/11/21
to TiddlyWiki
I'm desperately trying to get this to work. Non-english tiddler titles are essential for my project. 
I wonder if it will work with other browsers (Chrome, Edge, Firefox). I'm not restricted to Safari or TiddlyDesktop.

-keSh

Charlie Veniot

unread,
Sep 11, 2021, 1:02:48 PM9/11/21
to TiddlyWiki
I have no idea if this would technically work.

Even if it technically worked, I have no idea whether or not it would be crap (pardon my language!)

What if you kept tiddler titles in English, but then had non-english titles with unicode characters as aliases?

That aside, would the pending TiddlyWiki version 5.2.0 fix things?

PMario

unread,
Sep 11, 2021, 2:20:21 PM9/11/21
to TiddlyWiki
Hi,
I did create an issue at github: https://github.com/Jermolene/TiddlyWiki5/issues/6029 ...

There is no workaround and using any other browser won't help either. ...

Even if we find a matching regexp pattern, which can be used, there is some risk, that it will be way to slow, with a higher number of tiddlers.

-mario

keSh

unread,
Dec 24, 2021, 1:05:34 PM12/24/21
to TiddlyWiki
I'm following the issue at GitHub. 

Any updates ?

-kesh

PMario

unread,
Dec 25, 2021, 12:52:32 PM12/25/21
to TiddlyWiki
Hi,
Jeremy has changed the core regexp construction a little bit, but I didn't find a performant way to use an unicode regexp that JavaScript does understand. ... May be I missed something. ...
So no improvements atm :/
-mario

Mark S.

unread,
Dec 25, 2021, 1:51:02 PM12/25/21
to TiddlyWiki
With the link edit tool, it's pretty easy to insert the actual link to a tiddler.  freelinks depends on you matching an exact title, which can be difficult even with english titles. 

PMario

unread,
Dec 26, 2021, 5:44:54 AM12/26/21
to TiddlyWiki
@Mark S.
The advantage of freelinks is in a context, where you can't modify the content but you still want to have links. eg: Submitted homework tiddlers from students. Adding links to those tiddlers would mean to modify the original work in an unreasonable way. It wouldn't be the students work anymore.
-m

keSh

unread,
Dec 27, 2021, 1:07:41 PM12/27/21
to TiddlyWiki
That is exactly my use case. Only difference is that tiddler content and titles are not in English.
Thanks for looking into the issue. 

-kesh

Mark S.

unread,
Dec 27, 2021, 4:08:15 PM12/27/21
to TiddlyWiki

What language or character set are you targeting ?

It seems like a change to one line of code in the plugin can accommodate PMario's example. But not sure whether that would work for other languages.
 
var regexpStr = "(?<=^|[^a-zA-Zö])(?:" + reparts.join("|") + ")(?=$|[^a-zA-Zö])";

Yes, it depends on the browser having look-ahead. 

keSh

unread,
Jan 16, 2022, 5:40:07 PM1/16/22
to TiddlyWiki
@Mark S.  Thanks,

I'm using South Indian script Kannada: U+0C80–U+0CFF .
How do I include unicode range in the regexpStr ?

Browser is whatever engine comes with TiddlyDesktop on macOS. 
I can change to a more suitable browser if needed to support this feature. 


Mark S.

unread,
Jan 16, 2022, 8:23:02 PM1/16/22
to TiddlyWiki

Absolutely make a backup before unzipping, importing, saving, and reloading with the attached file. I am definitely out of my depth! You will probably need a modern (e.g. Chrome, Firefox) browser. This is not a universal solution (only adds Kannada), and there may be tweaks that need to be done (or actually undone) re case folding.

But it did appear to work – you can see the faint Kannada characters in this screen grab:


freelinks-kannada.png
$__core_modules_widgets_text.js.zip

keSh

unread,
Jan 20, 2022, 4:18:15 PM1/20/22
to TiddlyWiki
@Mark S.

Wanted to report back that it works for my purposes. 
I can now continue with my project which has been on hold for over 2 years. 

You are a godsend. Your efforts are much appreciated. 
Reply all
Reply to author
Forward
0 new messages