-
2008-11-11
jschwartz
I just noticed that double-quotes are not always matched properly. This is a little hard to show in a plain text message, but here is an example:
"tab" "{none}"
Becomes 0x93tab0x94 0x94{none}0x94 when rendered. (The hex values are the numeric codes for the actual characters; they aren't shown.)
It should be 0x93tab0x94 0x93{none}0x94
I've never delved into the code for DokuWiki, so I have no idea where the problem might lie.
-
2009-10-04
HåkanS
In the file inc/parser.php class Doku_Parser_Mode_quotes defines what should be considered whitespace.
today it's
778 $ws = '\s/\#~:+=&%@\-\x28\x29\]\[{}><"\''; // whitespace
making
793 $this->Lexer->addSpecialPattern(
794 "(?<=^|[$ws])\"(?=[^$ws$punc])",$mode,'doublequoteopening'
fail for all cases like "{test}" "-test" "#test" etc. I don't know why so many chars was included in the whitespace string but changing row 778 will also affect single quotes and apostrophes.
-
2012-11-08
zoof
This would seem to be a problem that ought to be fixed since I can't imagine that it is uncommon for quotation marks to surround links -- i.e., "{{_media/paper.pdf|Some paper title}}".
-
2013-10-14
Klap-in
Why are all these characters included as whitespace?
-
2014-02-15
andi
Quote matching is really complicated. I'm fine with applying any PR as long as it is accompanied by unit tests, but I don't really want to touch this ;-).
Be sure to test for quotes inside parenthesises and quotes containing quotes and quotes containing sentences and quotes ending before the sentence ends and so on.
-
2014-03-13
ChrisS
Currently, for some reason, we default to a ” (right double quotation mark) when a quotation mark doesn't match our doublequoteopening pattern. I think this behaviour is wrong. Double quotes are not normally used on their own. I propose a change to:
- track number of open double quotes.
- if there are no double quotes open and we didn't match our double quote opening pattern (currently would be doublequoteclosing) we trigger a double quote opening.
This would change the behaviour of a couple of existing tests:
Foo hello" Bar (TestOfDoku_Parser_Quotes::testDoubleQuoteClosing)
Foo hello") Bar (TestOfDoku_Parser_Quotes::testDoubleQuoteClosingSpecial)
I don't think these two tests (double quote closing) are particularly good. As pieces of text on their own, a closing double quote makes no sense (as does an opening double quote).
Under my proposal, these two snippets would change to be opening double quotes - however in a wiki page, if those snippets followed earlier text with opening double quotes, they would generate closing double quotes.
My proposal will correctly handle the following two proposed new tests (which the existing code doesn't).
Foo "{hello}" Bar
Foo "[[www.domain.com]]" Bar
Replacing the first quote in each snippet with an doublequoteopening and the second with a doublequoteclosing.
All other tests are unchanged.
-
2014-03-13
ChrisS
-
2014-03-24
Klap-in
by PR#612
-
Related tasks: