Wiki links for pages/synonyms that contain apostrophes
Example scenario, 3 pages exist:
Harry Potter (synonym: Harry)
Wands (synonym: Wand)
Harry's wand
In texts that contain "... harry's wand ...", the auto-linking won't work for the specific page, and it will instead auto link to the "Harry" and "Wands" pages.
Expectation: It should link to the "Harry's wand" page when that is found in text..
I'm guessing this has something to do with the regex used to split words, but I don't think it should be impossible to solve...
Assuming the number of pages in your wiki greatly exceeds the number of words in the affected content, you might try this. In src/addons/vw/vw/_core/model/parser/handle/autolink/vw.php. Find:
Code:
[\p{M}\w]+
Replace with:
Code:
[\p{M}\w]+(?:[\-\'][\p{M}\w]+)?
According to tests at regex101 this should additionally capture words that have apostrophe or hyphen in the middle (but not at either end). This should make autolinks now work for possessives or French-language words when there are a large number of wiki pages.
Unless you tell me in a day or two that you suddenly have unexpected autolink behavior due to the change, I believe this change is safe to release as the standard behavior, since not supporting French elisions was problematic.
This site uses cookies to help personalize content, to tailor your experience, and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.