From e3776c06c37cc197709dac60892604dfea894ac2 Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Mon, 29 Nov 2010 01:34:36 +0100 Subject: Remove enc=utf-8 in VIM modeline as it is not allowed in VIM 7.3 As of VIM 7.3 it is no longer possible to specify the encoding in the modeline. This gives an error message whenever such a file is opened, thus this commit removes the enc setting from the modeline. --- inc/parser/parser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/parser/parser.php') diff --git a/inc/parser/parser.php b/inc/parser/parser.php index 20f0e6ca3..2e6b7791a 100644 --- a/inc/parser/parser.php +++ b/inc/parser/parser.php @@ -957,4 +957,4 @@ class Doku_Parser_Mode_emaillink extends Doku_Parser_Mode { } -//Setup VIM: ex: et ts=4 enc=utf-8 : +//Setup VIM: ex: et ts=4 : -- cgit v1.2.3 From 9fa736b0317d46fdfb2025895fa0288fd736ca08 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Tue, 7 Dec 2010 16:09:01 +0100 Subject: Make baseonly work in allowedModes This makes it possible to have modes that do accept headers (baseonly) in the parser. Related test cases are still running through but I'm not 100% sure I did not break something here. So it should be tested a bit more. This patch will allow plugins to wrap multiple sections, however it also makes it possible to easily break XHTML validity, because headers also open and close sections, so plugin authors need to be aware! In case you wonder: this patch is not about allowing formatting inside headers. --- inc/parser/parser.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'inc/parser/parser.php') diff --git a/inc/parser/parser.php b/inc/parser/parser.php index 2e6b7791a..b93760f3a 100644 --- a/inc/parser/parser.php +++ b/inc/parser/parser.php @@ -90,7 +90,6 @@ class Doku_Parser { if ( $mode == 'base' ) { continue; } - $this->modes[$mode]->preConnect(); foreach ( array_keys($this->modes) as $cm ) { @@ -218,11 +217,11 @@ class Doku_Parser_Mode_footnote extends Doku_Parser_Mode { //------------------------------------------------------------------- class Doku_Parser_Mode_header extends Doku_Parser_Mode { - function preConnect() { + function connectTo($mode) { //we're not picky about the closing ones, two are enough $this->Lexer->addSpecialPattern( '[ \t]*={2,}[^\n]+={2,}[ \t]*(?=\n)', - 'base', + $mode, 'header' ); } -- cgit v1.2.3 From 5d190f120cede5be1da521fd1dc6e1beb0be394e Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 6 Feb 2011 11:28:35 +0100 Subject: URLs may contain brackets [] FS#2137 --- inc/parser/parser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/parser/parser.php') diff --git a/inc/parser/parser.php b/inc/parser/parser.php index b93760f3a..a1f9c9fe6 100644 --- a/inc/parser/parser.php +++ b/inc/parser/parser.php @@ -870,7 +870,7 @@ class Doku_Parser_Mode_externallink extends Doku_Parser_Mode { if(count($this->patterns)) return; $ltrs = '\w'; - $gunk = '/\#~:.?+=&%@!\-'; + $gunk = '/\#~:.?+=&%@!\-\[\]'; $punc = '.:?\-;,'; $host = $ltrs.$punc; $any = $ltrs.$gunk.$punc; -- cgit v1.2.3 From c34c77725873a495f375a815dd89be723cd2a512 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 6 Feb 2011 12:12:05 +0100 Subject: make IPv6 links in link syntax FS#2137 --- inc/parser/parser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/parser/parser.php') diff --git a/inc/parser/parser.php b/inc/parser/parser.php index a1f9c9fe6..a7764ee9c 100644 --- a/inc/parser/parser.php +++ b/inc/parser/parser.php @@ -828,7 +828,7 @@ class Doku_Parser_Mode_internallink extends Doku_Parser_Mode { function connectTo($mode) { // Word boundaries? - $this->Lexer->addSpecialPattern("\[\[.+?\]\]",$mode,'internallink'); + $this->Lexer->addSpecialPattern("\[\[(?:(?:.*?\[.*?\])|.+?)\]\]",$mode,'internallink'); } function getSort() { -- cgit v1.2.3 From f25fcf537e1a3223cce417ba01dc63d79b80a6f7 Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Wed, 9 Feb 2011 11:14:09 +0100 Subject: Make the regex for internal links more restrictive This fixes a PCRE backtrack error that occurred on large pages like :users on dokuwiki.org. --- inc/parser/parser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/parser/parser.php') diff --git a/inc/parser/parser.php b/inc/parser/parser.php index a7764ee9c..e47ce56fa 100644 --- a/inc/parser/parser.php +++ b/inc/parser/parser.php @@ -828,7 +828,7 @@ class Doku_Parser_Mode_internallink extends Doku_Parser_Mode { function connectTo($mode) { // Word boundaries? - $this->Lexer->addSpecialPattern("\[\[(?:(?:.*?\[.*?\])|.+?)\]\]",$mode,'internallink'); + $this->Lexer->addSpecialPattern("\[\[(?:(?:[^[\]]*?\[.*?\])|.+?)\]\]",$mode,'internallink'); } function getSort() { -- cgit v1.2.3 From 45a0fa152ba78aed840341ef83613c58c0ea706e Mon Sep 17 00:00:00 2001 From: Adrian Lang Date: Thu, 14 Apr 2011 07:57:49 +0200 Subject: Support the empty link [[]] --- inc/parser/parser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/parser/parser.php') diff --git a/inc/parser/parser.php b/inc/parser/parser.php index e47ce56fa..68d4e4569 100644 --- a/inc/parser/parser.php +++ b/inc/parser/parser.php @@ -828,7 +828,7 @@ class Doku_Parser_Mode_internallink extends Doku_Parser_Mode { function connectTo($mode) { // Word boundaries? - $this->Lexer->addSpecialPattern("\[\[(?:(?:[^[\]]*?\[.*?\])|.+?)\]\]",$mode,'internallink'); + $this->Lexer->addSpecialPattern("\[\[(?:(?:[^[\]]*?\[.*?\])|.*?)\]\]",$mode,'internallink'); } function getSort() { -- cgit v1.2.3