zioth / dokuwiki-autolink4

Dokuwiki plugin which automatically turns specified keywords into links to other wiki pages, similar to the default functionality of MediaWiki.
MIT License
0 stars 2 forks source link

Autolink for Persian language words #11

Closed nimahamidian closed 2 years ago

nimahamidian commented 2 years ago

Hi As it is said in the plugin's documentation page, for nonlatin languages (such as Persian), the core should be modified. But when the core code is modified the wiki crashes. So, I propose that this modification be applied to the next version of dokuwiki in its core. Thanks

zioth commented 2 years ago

I agree, but I don't own DokuWiki. You'll have to bring it up on their github. :) I believe it's been brought up before and rejected, but I don't remember why.

In the mean time, if you send me the change you made, maybe I can help you figure out why it crashed Doku. It could be that you have to enable something in your php installation.

nimahamidian commented 2 years ago

Thanks. I issued a comment on their website right now. As it is said in plugin's page I added the following code:

protected function getPerlMatchingFlags() { return ($this->case ? "umsS" : "umsSi"); }

to the file: /inc/Parsing/Lexer/ParallelRegex.php.

In fact, whenever I did any modification to DW core files, the DW crashed, either suddenly or gradually !

nimahamidian commented 2 years ago

Moreover, my DW (www.umolana.ir) is hosted in a shared hosting with following specifications: cPanel Version | 102.0 (build 12) Apache Version | 2.4.53 PHP Version | 7.0.33 MySQL Version | 10.3.34-MariaDB-cll-lve Architecture | x86_64 Operating System | linux Path to Perl | /usr/bin/perl Perl Version | 5.26.3 Kernel Version | 3.10.0-1160.el7.x86_64

zioth commented 2 years ago

Interesting. How did you edit the files? You should make sure that your editor uses linux newlines, and doesn't add special characters. Good editors for this would be emacs or vi on linux, or Notepad on Windows. MacOS TextEdit, Windows WordPad or Microsoft Word could mess up the file.

nimahamidian commented 2 years ago

Thanks. I used my cpanel file manager's default editor. I think the editor is OK, since I used it for other php or html files (e.g. main.php in the template directory) and it worked. My DW just crashes when I change core files such as the one mentioned above.

nimahamidian commented 2 years ago

Also the issue I already wrote in the core DW github has been refuted and closed !

zioth commented 2 years ago

What was the reasoning?

I don't know why editing core files would kill doku, unless they added a checksum or something for security. Is there anything in your error_log that might help?

nimahamidian commented 2 years ago

They didn't give any answer, just closed it !! maybe they meant it was irrelevant.

But I appreciate you because right now my problem has been resolved. Maybe the problem was what you mentioned about special characters. This time I changed "msS" : "msSi" to "umsS" : "umsSi" in the code, and now the autolink4 works for Persian. Thank you for your great help

zioth commented 2 years ago

Good to hear. I'm glad it's working!