I thought about extending the parsing for glossary items in the file Glossary.php but couldn't figure out how to modify the regular expression...
Glossary item:
IMAP = "Internet Message Access Protocol"
"IMAP server" is parsed correctly but "IMAP-server" is not parsed - I would like to allow for glossary items in the faq-entries to be followed by a hypen ("-") and still be parsed correctly and equipped with an explanation!
I think the function insertItemsIntoContent() from the file Glossary.php should be modified but can't figure out how to do it - can anybody help me out?
Extend the parsing for glossary items
Moderator: Thorsten
Extended parsing of glossary/dictionary items
I've modified the file .\inc\Glossary.php - more specifically the function insertItemsIntoContent(), line 129:
// c. the glossary item could be everywhere as a distinct word
.'(\s+)('.$item['item'].')\b' // <-- new line
//.'(\s+)('.$item['item'].')(\s+)' <-- old line
I read about the regular expression syntax on this page:
http://dk.php.net/manual/en/reference.p ... syntax.php
And tried using a word boundary {\b} instead of a white space character class {(\s+)}- notice a word boundary can't be used inside a character class!
Result is that the following instances of FAQ are also matched:
FAQ-...
FAQ. ....
FAQ, ...
FAQ's ...
Regards, Tommy Ipsen
// c. the glossary item could be everywhere as a distinct word
.'(\s+)('.$item['item'].')\b' // <-- new line
//.'(\s+)('.$item['item'].')(\s+)' <-- old line
I read about the regular expression syntax on this page:
http://dk.php.net/manual/en/reference.p ... syntax.php
And tried using a word boundary {\b} instead of a white space character class {(\s+)}- notice a word boundary can't be used inside a character class!
Result is that the following instances of FAQ are also matched:
FAQ-...
FAQ. ....
FAQ, ...
FAQ's ...
Regards, Tommy Ipsen