glensc / dokuwiki-plugin-pageredirect

Redirects page requests based on content
https://www.dokuwiki.org/plugin:pageredirect
19 stars 19 forks source link

Easy syntax conflict #18

Closed colintedford closed 7 years ago

colintedford commented 9 years ago

I just belatedly updated from "Ponder Stibbons" to "Hrun" and my redirects using the #redirect syntax now show "1. redirect [pagename]" instead of redirecting. The ~~REDIRECT> style still works, but of course my existing redirects use #redirect because it's easier to type.

jayqi commented 9 years ago

Are you perhaps using the Creole plugin or some other plugin that uses # as the syntax for an ordered list? That looks to be what is happening. I am using Creole, and I have the same syntax conflict, so I've been stuck using the ~~REDIRECT> option.

colintedford commented 9 years ago

Aha, I am using the Creole plugin; thanks for dispelling the mystery.

glensc commented 7 years ago

looks like parser::parse():118 prepends \n to document and creole matches \n# first, breaking pageredirect plugin able to match full word

so even if your document content is: #redirect start when document is parsed it becames \n#redirect start\n

and here's creole pattern that is overly greedy: syntax_plugin_creole_listblock::connectTo()

             $this->Lexer->addEntryPattern(
                '\n[ \t]*[\#\*](?!\*)',
                $mode,
                'plugin_creole_listblock'
             );
glensc commented 7 years ago

should be fixed with 36ebf4a