[dokuwiki] Patch allowing display table control characters

  • From: Izidor Matusov <izidor.matusov@xxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Tue, 23 Jun 2009 21:58:35 +0200

Hi,

I often need to show in table control characters | and ^. (E.g. ls | wc
-l, egrep -i '^expression' file).

As far as I know DokuWiki does not support using these characters in
tables. Therefore I write this patch. It simply adds pattern into
parser to allow using them together with '\' prefix.

Now I can type ls \| wc -l or egrep -i
'\^expression' file and I do not have problem with table.

I would appreciate your feedback.

-- 
Izidor Matusov
http://iziapolo.blogspot.com
http://twitter.com/iyonius
Tue Jun 23 21:02:22 CEST 2009  Izidor Matusov <izidor.matusov@xxxxxxxxx>
  * tableDisplayControlChars.patch

New patches:

[tableDisplayControlChars.patch
Izidor Matusov <izidor.matusov@xxxxxxxxx>**20090623190222
 Ignore-this: ce75a075373a3cd186f75b1ed3a0da0d
] {
hunk ./inc/parser/handler.php 627
                     $this->_addCall('tablecell', array(), $pos);
                 } else if ( $match == '^' ) {
                     $this->_addCall('tableheader', array(), $pos);
-                }
+                } else if ( $match == '\|' ) {
+                    $this->_addCall('table_display', array('|'), $pos);
+                } else if ( $match == '\^' ) {
+                    $this->_addCall('table_display', array('^'), $pos);
+                } 
             break;
         }
         return true;
hunk ./inc/parser/parser.php 452
     }
 
     function postConnect() {
+        $this->Lexer->addPattern("\\\\\\|",'table');
+        $this->Lexer->addPattern("\\\\\\^",'table');
         $this->Lexer->addPattern('\n\^','table');
         $this->Lexer->addPattern('\n\|','table');
         #$this->Lexer->addPattern(' {2,}','table');
hunk ./inc/parser/renderer.php 238
 
     function table_close(){}
 
+    function table_display($char){}
+
     function tablerow_open(){}
 
     function tablerow_close(){}
hunk ./inc/parser/xhtml.php 832
         $this->doc .= '</table>'.DOKU_LF;
     }
 
+    function table_display($char) {
+        $this->doc .= $char;
+    }
+
     function tablerow_open(){
         // initialize the cell counter used for classes
         $this->_counter['cell_counter'] = 0;
}

Context:

[Redesigned admin screen
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090606101045
 Ignore-this: a0d2db2839de9eacbd6a853c39ed592c
 
 This patch reorders the admin screen to make the main tasks better accessible.
 This was inspired by a similar plugin by HÃ¥kan Sandell [1]
 
 [1] http://www.dokuwiki.org/plugin:adminhomepage 
] 
[Added tpl_include_page() function for template author's convenience
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090605174949
 Ignore-this: ab880c4bdaf2e4e8d272f552fd88aa24
] 
[fix printf calls in mediamanager FS#1711
Christian Marg <marg@xxxxxxxxxxxxxxxxxx>**20090605150728
 Ignore-this: a8fb901f3bea94cd3052555e05e70486
] 
[another attempt to fix recursion depth in media search
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090605110519
 Ignore-this: 7d58d0069959747b9e20eefaabb7e1d5
] 
[Moved HTTPCLIENT_REQUEST_SEND event
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090605104603
 Ignore-this: 8e7c6aae103f1bced33a74a2440c2fe8
 
 This patch moves the HTTPCLIENT_REQUEST_SEND event from HTTPClient to
 DokuHTTPClient. This keeps the main HTTPClient class free from any DokuWiki
 specific code for easier reuse elsewhere.
] 
[Don't accept gzip encoding in HTTP client when content is expected to be 
truncated FS#1710
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090605103531
 Ignore-this: 6bd3d5f18e32356a0efd908962ce78e4
] 
[Multiple enhancements in the flash uploader
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090604230010
 Ignore-this: 9f05194de64b5e5d47fa45bb45814f8d
] 
[Portuguese language update
André Neves <drakferion@xxxxxxxxx>**20090604174718
 Ignore-this: 50dd49b64f7f923fbf071a1dd49c807d
] 
[reset scroll position when setting selection FS#1707
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090603170042
 Ignore-this: cb035f32eccc0fcb2c9163b8620abb91
] 
[French language update
Goulven <littlebmxdevil@xxxxxxxxx>**20090603164023
 Ignore-this: cbe3c01cdc41d589bae06fc9933ba859
] 
[fixed limit typo in explode call
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090603163836
 Ignore-this: fbd08a31ded98f7517ca679047845f6
] 
[Clean up cookie handler in HTTPClient
Tom N Harris <tnharris@xxxxxxxxxxxxx>**20090528215037] 
[accesskeys for list items
Andreas Gohr <gohr@xxxxxxxxxxxx>**20090603092328
 Ignore-this: 321cb1598c9aacaf00e21f5a54d1a1cc
] 
[Change expensive uses of split to the much faster explode.
Tom N Harris <tnharris@xxxxxxxxxxxxx>**20090528215438] 
[Basque language update
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090602170446
 Ignore-this: bb88ed95400b4a814a872750f0fa3758
] 
[Valencian language update
Bernat Arlandis i Mañó <berarma@xxxxxx>**20090602170323
 Ignore-this: f3ddce09c85f838cef24ada7c8e27c9e
] 
[Enhance "locked by" page
Andy Webber <dokuwiki@xxxxxxxxxxxxxx>**20090531132514
 Make "locked by" name in main part of locked page use "showuseras" config (via 
editorinfo()). This was missed from editor_info_patch of October 2008  
] 
[TAG develsnap 2009-06-01
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090531230002] 
[fix JS when compaction is enabled
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090528161552
 Ignore-this: 4a6d9f3da25a04ec132cca2297328b1
] 
[new headline mechanism in the toolbar
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090528155327
 Ignore-this: f87882b727bcf6ea067945eea0f158b1
 
 The toolbar now features three new buttons to insert a headline. Instead of
 asking the user for the headline level it asks if she wants a higher, lower
 or equally leveled section (relative to the current one).
 
 This means the user no longer has to count in which section she currently is
 and encourages users to use the proper order of headline levels.
 
 To make room in the toolbar, the old buttons have been moved in a picker.
] 
[Make sub-toolbars in pickers possible
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090528153507
 Ignore-this: ace153a4684f7b345df56d796717a172
 Now all types of buttons kan also be placed in a toolbar picker window. It
 should even be possible to create deep nested picker cascades.
] 
[more javascript refactoring
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090528121543
 Ignore-this: 10badc0f97ef80fcd366ae4622c43ff1
] 
[start of toolbar javascript refactoring
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090515173045
 Ignore-this: 81ef7a71e6910751bf5d6c1b592978c4
] 
[Don't check for CSRF attacks when no user is logged in FS#1619
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090527112243
 Ignore-this: 3ef4fafa34a7bbba76435b5db6935b57
 
 There is no need to fight against a privilege stealing attack when the
 attacked user has no privileges.
 
 Skipping the check reenables editing without cookies again.
] 
[increased message id
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090526145512
 Ignore-this: 9b004a1bec25263f57e5de96b65cd545
] 
[SECURITY: fix local file inclusion with register globals
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090526145030
 Ignore-this: ce01faedc6c3d9370362b0e1e39ded36
 
 This fixes a security hole when register_globals is enabled. An exploit is
 in the wild: http://www.milw0rm.com/exploits/8781
] 
[addes Active Directory auth method (ad)
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090526140527
 Ignore-this: 773a7e7293d5f35bb8c9ed9fba2759b5
] 
[fixed a spam check hole FS#1620 and made the wordblock check more flexible
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090526120748
 Ignore-this: 74d18220baea88b5826d46c78998fa04
] 
[removed license info for dokuwiki.org content
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090526112917
 Ignore-this: 57fff85207a352f67a5c5acc9aa7ec99
 Since this info now is given at the footer of each page it doesn't make sense
 to include it into the released file anymore.
] 
[disable diff button when no two revisions are selected FS#1663
Mikhail I. Izmestev <izmestev@xxxxxxxxxxxxxxx>**20090526104223
 Ignore-this: 9c8cf4530d94d7168e34158c59ee4c66
] 
[fixed function documentation FS#1695
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090526102411
 Ignore-this: 9fa16a2aec98eec2a330a7de9e4a2def
] 
[don't include search string into hierarchical breadcrumbs FS#1672
Alexey Torkhov <atorkhov@xxxxxxxxx>**20090526100758
 Ignore-this: 7611558571da7ac66b9fd5e2b17b1750
] 
[GeSHi update to 1.0.8.4
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090526092917
 Ignore-this: 455792081bedfbe25399d53aa7f93da5
] 
[extended interwiki links FS#1612
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090526090130
 Ignore-this: 944df9f3682bb7ac8a2d7d4c94455ba
] 
[Fix visible passwords in usermanager plugin FS#1624
Timo Voipio <tvoipio@xxxxxxxxx>**20090526084719
 Ignore-this: 3dc13a990c4b6eadeb02065f08460e09
] 
[fix incorrect trimming in blowfish library FS#1690
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090526083636
 Ignore-this: 3aee0c821e12117514c856741d7b78c1
] 
[upgraded the blowfish library to upstream version
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090526083317
 Ignore-this: 59e4981579f4b071f0802ed6e285f30b
] 
[don't pass function return as reference in html_hilight()
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090526073013
 Ignore-this: 19a8e8cbdbafea2268a31a08a65f4e05
 
 This was actually reported [1] as a bug elsewhere, but really should be
 fixed in DokuWiki and now is.
 
 [1] https://www.projectzero.org/bugzilla/show_bug.cgi?id=8671
 
] 
[removed more language strings for purple numbers
Anika Henke <anika@xxxxxxxxxxxxxxx>**20090525212742] 
[removed purple numbers
Anika Henke <anika@xxxxxxxxxxxxxxx>**20090525194435] 
[Spanish language update
Javier Aranda <javierav@xxxxxxxxxxxx>**20090525172137
 Ignore-this: f839ee8f30d4ebf9158d3b1934c22c94
] 
[Lithunian language update
Audrius Klevas <audrius.klevas@xxxxxxxxx>**20090525171951
 Ignore-this: 6ba9ffc7fc360fa651bc6eff42f39862
] 
[Croatian language update
Branko Rihtman <theney@xxxxxxxxx>**20090525171838
 Ignore-this: 939c64e068291798fdf89d9d01a2c091
] 
[Marathi language update
Padmanabh Kulkarni <kulkarnipadmanabh@xxxxxxxxx>**20090523101653
 Ignore-this: 7083042bac15e28defd65b8f12e33345
] 
[Turkish language update
Yavuz Selim <yavuzselim@xxxxxxxxx>**20090523101531
 Ignore-this: 4f40b8b124a0f297834237d28ebfdf69
] 
[Latvian language update
Aivars Miska <allefm@xxxxxxxxx>**20090523101137
 Ignore-this: 6b06a58d6b64f15d7f18537545d01ef
] 
[German language update
Dirk Einecke <dirk@xxxxxxxxxxxxxx>**20090517100609
 Ignore-this: de983218cb2332f4b415b998d18ec576
] 
[added tpl_action() (wrapper around tpl_button and tpl_actionlink)
Anika Henke <anika@xxxxxxxxxxxxxxx>**20090516173858] 
[optionally return instead of print tpl_button() and tpl_actionlink()
Anika Henke <anika@xxxxxxxxxxxxxxx>**20090516165345] 
[Portuguese language update
Fil <fil@xxxxxxxxxxx>**20090516230648
 Ignore-this: 5120879eef36e3c42c724b85b82fcd11
] 
[French language update
Guillaume Turri <guillaume.turri@xxxxxxxxxxxxxxxxxx>**20090516122205
 Ignore-this: de708804321143bb34bea0920ec7e30b
] 
[Brazilian Portuguese language update
Jeferson Propheta <jeferson.propheta@xxxxxxxxx>**20090516121923
 Ignore-this: 8684965a8410468b6fe690b40511a774
] 
[restrict XMLRPC to configurable groups and users
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090516114351
 Ignore-this: 1370cee84d44bb35ae7c0c988ed8f1ff
 
 This patch adds a config option to define users or groups that may access
 the XMLRPC API. ACLs are still checked on top of this intial access control.
] 
[fix for getID() when the script isn't installed in document root FS#1691
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090515184406
 Ignore-this: 2757dc089bd6c8465e5b0a4c1311cf85
] 
[Added testcase for dokuwiki url rewriting and dokuwiki outside of document 
root.
michael@xxxxxxxxxxxxxxxx**20090514155859
 Ignore-this: d38dd22b55ddb7ac94d28fa048130672
] 
[fixed the media listing recursion limit check again
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090515101112
 Ignore-this: c1b12d1fbde51ee80e24fcd9b731a161
] 
[Minor change support for dwpage.php
Dirk Best <startaq@xxxxxxxxx>**20090514151011] 
[Windows path handling error in TarLib.class
hakan.sandell@xxxxxxxxx**20090428172025] 
[flash sources will be included in next release
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090514204048
 Ignore-this: 5deb81b5d621fb506f9604c5a6c2f938
] 
[Brazilian Portuguese language update
Frederico Gonçalves Guimarães <frederico@xxxxxxxxxxx>**20090514202625
 Ignore-this: e7a1a44a5970faf3b81fef34eb3a306a
] 
[Portoguese language update
Fil <fil@xxxxxxxxxxx>**20090512163424
 Ignore-this: 6aa4641d64b3a43ffa6a4ea1c9091b19
] 
[.final (?) fix for purple numbers
Anika Henke <anika@xxxxxxxxxxxxxxx>**20090506204753] 
[fix for purple numbers
Anika Henke <anika@xxxxxxxxxxxxxxx>**20090506202433] 
[Purple Numbers (granular hierarchical IDs) - set $conf['purplenumbers'] and 
adjust your CSS
Anika Henke <anika@xxxxxxxxxxxxxxx>**20090504222544] 
[Turkish language update
Cihan Kahveci <kahvecicihan@xxxxxxxxx>**20090510120449
 Ignore-this: e270b3d3d0b158ec5edc2d8150675f78
] 
[Renamed Valencian translation from ca-va to correct IANA tag ca-valencia
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090510115203
 Ignore-this: a5dc0ced725b17e4e2900c6183cb8df1
] 
[Traditional Chinese language update
L.J. Huang <ljhuang.tw@xxxxxxxxx>**20090510114851
 Ignore-this: cec7d286074cdc4fae2c10c3d7dd2140
] 
[Swedish language update
Tormod Johansson <tormod.otter.johansson@xxxxxxxxx>**20090510114350
 Ignore-this: 94fcf25ae7b0c6905b41381abdedd922
] 
[Marathi language update
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090510114030
 Ignore-this: 26c8053872950ebd1713dfef011f7e08
] 
[Slovenian language update
BoÅ¡tjan SeniÄ?ar <senicar@xxxxxxxxx>**20090510113908
 Ignore-this: d3885673c9b277a3fd9831d95cfa5faf
] 
[Traditional Chinese language update
Wayne San <waynesan@xxxxxxxxxxx>**20090510113736
 Ignore-this: 1574044b5ced913648d0f9b4500b58e1
] 
[Polish language update
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090509105031
 Ignore-this: 5bf6c4c397cf2f6e5d2136022b83e0a6
] 
[Slovak language update
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090509104947
 Ignore-this: 72cb52150e08d72e958958d237498679
] 
[Greek language update
Thanos Massias <tm@xxxxxxxxxxx>**20090509104848
 Ignore-this: d7ec1a5c2420da4eaf46665a15b6bd82
] 
[Serbian language update
Ivan PetroviÄ? <petrovicivan@xxxxxxxxxxxxxxxx>**20090507195407
 Ignore-this: e4446d8959dca9f6e82bac32796e3a4b
] 
[Hungarian language update
Siaynoq Mage <siaynoqmage@xxxxxxxxx>**20090507165019
 Ignore-this: e44d4839b8d92dcd1412c7acdfa0e455
] 
[Korean language update
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090507164913
 Ignore-this: ba9385776e8a488616f140d301d00aac
] 
[Catalan language update
Carles Bellver <carles.bellver@xxxxxxxxxxx>**20090507164613
 Ignore-this: 4375d86f0f3cd449cb24b30e3d8e965e
] 
[Greek language update
Thanos Massias <tm@xxxxxxxxxxx>**20090507164456
 Ignore-this: c4a55b618bc097000b5971e406e144c5
] 
[Persian language update
Omid Mottaghi <omidmr@xxxxxxxxx>**20090507164338
 Ignore-this: 304380979424358b701990319492ac7b
] 
[Serbian language update
Ivan PetroviÄ? <petrovicivan@xxxxxxxxxxxxxxxx>**20090507164209
 Ignore-this: 3790caf9aed37b896f1cb951d97173bc
] 
[Slovak language update
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090507164046
 Ignore-this: 3837a643348a1b3de37e64337ba3fc3b
] 
[Czech language update
tomas@xxxxxxxxxx**20090507163952
 Ignore-this: 59e6f832b1b8da77c45c332b8ade8538
] 
[Brazilian Portuguese language update
Jair Henrique <jair.henrique@xxxxxxxxx>**20090507163831
 Ignore-this: f758531cbad5914e4715c50d9a459e77
] 
[better search snippets FS#1669
Chuck Kollars <ckollars9@xxxxxxxxx>**20090504183835
 Ignore-this: fdf33ea5a6c50a597bd432c0da98e927
 Snippets containing more of the seached words are preferred
 over ones containing less search keywords
] 
[fixed GET support in lib/exe/ajax.php FS#1679
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090504181055
 Ignore-this: e77d9d77e6a02bb18b0cf7043a7eb3cb
] 
[TAG develsnap 2009-05-01
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20090430230001] 
Patch bundle hash:
caba0a151f054fc15924bd5ce37e67bd661e44c8

Other related posts: