Translations of this page?:

Rewrite Blocks

Here is a suggestion to improve the performance of inc/parser/handler.php and to remove redundant linebreaks in the first cdata of a block element (which could fix a problem in plugin:xbr).

Summary:

  • Opens a paragraph at block begin and let it close empty if a block is encountered, instead of checking next call in the whole run.
  • Directly skips multiple eols after block begin and end, instead of many opening and closing paragraphs.
handler.php
@@ -1489,6 +1489,11 @@
         }
     }
 
+    function openParagraph($pos){
+        $this->calls[] = array('p_open',array(), $pos);
+        $this->inParagraph = true;
+    }
+
     /**
      * Close a paragraph if needed
      *
@@ -1548,7 +1553,7 @@
                     $this->closeParagraph($call[2]);
                 }
                 $this->calls[] = $call;
-
+                $this->skipEolKey = $key+1;
                 continue;
             }
 
@@ -1561,104 +1566,73 @@
                 if ($this->removeFromStack()) {
                     $this->calls[] = array('p_open',array(), $call[2]);
                 }
+                $this->skipEolKey = $key+1;
                 continue;
             }
 
-            if ( !$this->atStart ) {
+            // Always opens a paragraph on stack start
+            // If this is a block start, it will soon be closed later
+            if ( $this->atStart ) {
+                $this->openParagraph($call[2]);
+                $this->atStart = false;
+                $this->skipEolKey = $key;
+            }
 
-                if ( $cname == 'eol' ) {
+            if ( $cname == 'eol' ) {
 
-                    // Check this isn't an eol instruction to skip...
-                    if ( $this->skipEolKey != $key ) {
-                        // Look to see if the next instruction is an EOL
-                        if ( isset($calls[$key+1]) && $calls[$key+1][0] == 'eol' ) {
+                // Check this isn't an eol instruction to skip...
+                if ( $this->skipEolKey != $key ) {
+                    // Look to see if the next instruction is an EOL
+                    if ( isset($calls[$key+1]) && $calls[$key+1][0] == 'eol' ) {
 
-                            if ( $this->inParagraph ) {
-                                //$this->calls[] = array('p_close',array(), $call[2]);
-                                $this->closeParagraph($call[2]);
-                            }
+                        if ( $this->inParagraph ) {
+                            $this->closeParagraph($call[2]);
+                        }
+                        $this->openParagraph($call[2]);
+                        // Mark the next instruction for skipping
+                        $this->skipEolKey = $key+1;
+                    } else {
+                        //if this is just a single eol make a space from it
+                        $this->addCall(array('cdata',array(DOKU_PARSER_EOL), $call[2]));
+                    }
+                } else {
+                    $this->skipEolKey = $key+1;
+                }
 
-                            $this->calls[] = array('p_open',array(), $call[2]);
-                            $this->inParagraph = true;
 
+            } else {
 
-                            // Mark the next instruction for skipping
-                            $this->skipEolKey = $key+1;
+                $storeCall = true;
+                if ( $this->inParagraph && (in_array($cname, $this->blockOpen) && (!$plugin || $plugin_open))) {
+                    $this->closeParagraph($call[2]);
+                    $this->calls[] = $call;
+                    $storeCall = false;
+                    // Mark next eol(s) for skipping
+                    $this->skipEolKey = $key+1;
+                }
 
-                        }else{
-                            //if this is just a single eol make a space from it
-                            $this->addCall(array('cdata',array(DOKU_PARSER_EOL), $call[2]));
-                        }
+                if ( in_array($cname, $this->blockClose) && (!$plugin || $plugin_close)) {
+                    if ( $this->inParagraph ) {
+                        $this->closeParagraph($call[2]);
                     }
-
-
-                } else {
-
-                    $storeCall = true;
-                    if ( $this->inParagraph && (in_array($cname, $this->blockOpen) && (!$plugin || $plugin_open))) {
-                        $this->closeParagraph($call[2]);
+                    if ( $storeCall ) {
                         $this->calls[] = $call;
                         $storeCall = false;
                     }
-
-                    if ( in_array($cname, $this->blockClose) && (!$plugin || $plugin_close)) {
-                        if ( $this->inParagraph ) {
-                            $this->closeParagraph($call[2]);
-                        }
-                        if ( $storeCall ) {
-                            $this->calls[] = $call;
-                            $storeCall = false;
-                        }
-
-                        // This really sucks and suggests this whole class sucks but...
-                        if ( isset($calls[$key+1])) {
-                            $cname_plusone = $calls[$key+1][0];
-                            if ($cname_plusone == 'plugin') {
-                                $cname_plusone = 'plugin'.$calls[$key+1][1][0];
-
-                                // plugin test, true if plugin has a state which precludes it requiring blockOpen or blockClose
-                                $plugin_plusone = true;
-                                $plugin_test = ($call[$key+1][1][2] == DOKU_LEXER_MATCHED) || ($call[$key+1][1][2] == DOKU_LEXER_MATCHED);
-                            } else {
-                                $plugin_plusone = false;
-                            }
-                            if ((!in_array($cname_plusone, $this->blockOpen) && !in_array($cname_plusone, $this->blockClose)) ||
-                                ($plugin_plusone && $plugin_test)
-                                ) {
-
-                                $this->calls[] = array('p_open',array(), $call[2]);
-                                $this->inParagraph = true;
-                            }
-                        }
-                    }
-
-                    if ( $storeCall ) {
-                        $this->addCall($call);
-                    }
-
+                    $this->openParagraph($call[2]);
+                    // Mark next eol(s) for skipping
+                    $this->skipEolKey = $key+1;
                 }
-
-
-            } else {
-
-                // Unless there's already a block at the start, start a paragraph
-                if ( !in_array($cname,$this->blockOpen) ) {
-                    $this->calls[] = array('p_open',array(), $call[2]);
-                    if ( $call[0] != 'eol' ) {
-                        $this->calls[] = $call;
-                    }
-                    $this->atStart = false;
-                    $this->inParagraph = true;
-                } else {
+                if ( $storeCall ) {
                     $this->addCall($call);
-                    $this->atStart = false;
                 }
-
             }
 
         }
 
         if ( $this->inParagraph ) {
+            $call = end($this->calls);
+            $cname = $call[0];
             if ( $cname == 'p_open' ) {
                 // Ditch the last call
                 array_pop($this->calls);

A demo page can be seen at demo. And the following is the diff of the new handler to the old one (both export_xhtmlbody):

demo
@@ -17,7 +17,6 @@
 <div class="level2">
 
 <p>
-
 test
 </p>
 
@@ -36,7 +35,6 @@
 <div class="level2">
 
 <p>
-
 test
 </p>
 
@@ -46,7 +44,6 @@
 <div class="level2">
 
 <p>
-
 Spacing 0
 </p>
 
@@ -55,7 +52,6 @@
 </p>
 
 <p>
-
 Spacing 2
 </p>
 
@@ -69,7 +65,6 @@
 <div class="level2">
 
 <p>
-
 <br/>
 <br/>
 <br/>
@@ -108,7 +103,6 @@
 </table></div>
 <!-- EDIT10 TABLE [402-419] -->
 <p>
-
 test
 
 </p>
@@ -129,7 +123,6 @@
 </table></div>
 <!-- EDIT12 TABLE [453-470] -->
 <p>
-
 test
 
 </p>
@@ -144,7 +137,6 @@
 Indent Spacing 2</div></blockquote>
 
 <p>
-
 test
 
 </p>
@@ -159,13 +151,11 @@
 Indent Spacing 4</div></blockquote>
 
 <p>
-
 test
 </p>
 <pre class="code">Code Spacing 1</pre>
 
 <p>
-
 test
 </p>
 <pre class="code">Code Spacing 2</pre>
@@ -176,7 +166,6 @@
 <pre class="code">Code Spacing 3</pre>
 
 <p>
-
 test
 </p>
 <pre class="code">Code Spacing 4</pre>
@@ -200,7 +189,6 @@
 </ul>
 
 <p>
-
 test
 
 </p>
@@ -219,7 +207,6 @@
 </ul>
 
 <p>
-
 test
 </p>
 

And here's the diff of wiki:syntax.

wiki:syntax
@@ -3,7 +3,6 @@
 <div class="level1">
 
 <p>
-
 <a href="http://www.dokuwiki.org/DokuWiki" class="interwiki iw_doku" title="http://www.dokuwiki.org/DokuWiki">DokuWiki</a> supports some simple markup language, which tries to make the datafiles to be as readable as possible. This page contains all possible syntax you may use when editing the pages. Simply have a look at the source of this page by pressing the <em>Edit this page</em> button at the top or bottom of the page. If you want to try something, just use the <a href="/dws/playground/%E9%A0%81%E5%90%8D%E6%B8%AC%E8%A9%A62" class="wikilink2" title="playground:頁名測試2" rel="nofollow">playground</a> page. The simpler markup is easily accessible via <a href="http://www.dokuwiki.org/toolbar" class="interwiki iw_doku" title="http://www.dokuwiki.org/toolbar">quickbuttons</a>, too.
 </p>
 
@@ -13,7 +12,6 @@
 <div class="level2">
 
 <p>
-
 DokuWiki supports <strong>bold</strong>, <em>italic</em>, <em class="u">underlined</em> and <code>monospaced</code> texts. Of course you can <strong><em class="u"><em><code>combine</code></em></em></strong> all these.
 
 </p>
@@ -21,21 +19,18 @@
 Of course you can **__//&#039;&#039;combine&#039;&#039;//__** all these.</pre>
 
 <p>
-
 You can use <sub>subscript</sub> and <sup>superscript</sup>, too.
 
 </p>
 <pre class="code">You can use &lt;sub&gt;subscript&lt;/sub&gt; and &lt;sup&gt;superscript&lt;/sup&gt;, too.</pre>
 
 <p>
-
 You can mark something as <del>deleted</del> as well.
 
 </p>
 <pre class="code">You can mark something as &lt;del&gt;deleted&lt;/del&gt; as well.</pre>
 
 <p>
-
 <strong>Paragraphs</strong> are created from blank lines. If you want to <strong>force a newline</strong> without a paragraph, you can use two backslashes followed by a whitespace or the end of line.
 </p>
 
@@ -53,7 +48,6 @@
 or followed by\\ a whitespace \\this happens without it.</pre>
 
 <p>
-
 You should use forced newlines only if really needed.
 </p>
 
@@ -63,7 +57,6 @@
 <div class="level2">
 
 <p>
-
 DokuWiki supports multiple ways of creating links.
 </p>
 
@@ -73,7 +66,6 @@
 <div class="level3">
 
 <p>
-
 External links are recognized automagically: <a href="http://www.google.com" class="urlextern" target="_blank" title="http://www.google.com"  rel="nofollow">http://www.google.com</a> or simply <a href="http://www.google.com" class="urlextern" target="_blank" title="http://www.google.com"  rel="nofollow">www.google.com</a> - You can set the link text as well: <a href="http://www.google.com" class="urlextern" target="_blank" title="http://www.google.com"  rel="nofollow">This Link points to google</a>. Email addresses like this one: <a href="mailto:&#x61;&#x6e;&#x64;&#x69;&#x40;&#x73;&#x70;&#x6c;&#x69;&#x74;&#x62;&#x72;&#x61;&#x69;&#x6e;&#x2e;&#x6f;&#x72;&#x67;" class="mail JSnocheck" title="&#x61;&#x6e;&#x64;&#x69;&#x40;&#x73;&#x70;&#x6c;&#x69;&#x74;&#x62;&#x72;&#x61;&#x69;&#x6e;&#x2e;&#x6f;&#x72;&#x67;">&#x61;&#x6e;&#x64;&#x69;&#x40;&#x73;&#x70;&#x6c;&#x69;&#x74;&#x62;&#x72;&#x61;&#x69;&#x6e;&#x2e;&#x6f;&#x72;&#x67;</a> are recognized, too.
 
 </p>
@@ -88,7 +80,6 @@
 <div class="level3">
 
 <p>
-
 Internal links are created by using square brackets. You can either just give a <a href="/dws/wiki/pagename" class="wikilink2" title="wiki:pagename" rel="nofollow">pagename</a> or use an additional <a href="/dws/wiki/pagename" class="wikilink2" title="wiki:pagename" rel="nofollow">link text</a>.
 
 </p>
@@ -96,7 +87,6 @@
 a [[pagename]] or use an additional [[pagename|link text]].</pre>
 
 <p>
-
 <a href="http://www.dokuwiki.org/pagename" class="interwiki iw_doku" title="http://www.dokuwiki.org/pagename">Wiki pagenames</a> are converted to lowercase automatically, special characters are not allowed.
 </p>
 
@@ -107,7 +97,6 @@
 <pre class="code">You can use [[some:namespaces]] by using a colon in the pagename.</pre>
 
 <p>
-
 For details about namespaces see <a href="http://www.dokuwiki.org/namespaces" class="interwiki iw_doku" title="http://www.dokuwiki.org/namespaces">namespaces</a>.
 </p>
 
@@ -118,7 +107,6 @@
 <pre class="code">This links to [[syntax#internal|this Section]].</pre>
 
 <p>
-
 Notes:
 
 </p>
@@ -137,7 +125,6 @@
 <div class="level3">
 
 <p>
-
 DokuWiki supports <a href="http://www.dokuwiki.org/Interwiki" class="interwiki iw_doku" title="http://www.dokuwiki.org/Interwiki">Interwiki</a> links. These are quick links to other Wikis. For example this is a link to Wikipedia&#039;s page about Wikis: <a href="http://en.wikipedia.org/wiki/Wiki" class="interwiki iw_wp" title="http://en.wikipedia.org/wiki/Wiki">Wiki</a>.
 
 </p>
@@ -150,14 +137,12 @@
 <div class="level3">
 
 <p>
-
 Windows shares like <a href="file://///server/share" class="windows" title="\\server\share">this</a> are recognized, too. Please note that these only make sense in a homogeneous user group like a corporate <a href="http://en.wikipedia.org/wiki/Intranet" class="interwiki iw_wp" title="http://en.wikipedia.org/wiki/Intranet">Intranet</a>.
 
 </p>
 <pre class="code">Windows Shares like [[\\server\share|this]] are recognized, too.</pre>
 
 <p>
-
 Notes:
 
 </p>
@@ -175,14 +160,12 @@
 <div class="level3">
 
 <p>
-
 You can also use an image to link to another internal or external page by combining the syntax for links and <a href="#images_and_other_files" title="wiki:syntax &crarr;" class="wikilink1">images</a> (see below) like this:
 
 </p>
 <pre class="code">[[http://www.php.net|{{wiki:dokuwiki-128.png}}]]</pre>
 
 <p>
-
 <a href="http://www.php.net" class="media" target="_blank" title="http://www.php.net"  rel="nofollow"><img src="/dws/_media/wiki/dokuwiki-128.png" class="media" alt="" /></a>
 </p>
 
@@ -200,7 +183,6 @@
 <div class="level2">
 
 <p>
-
 You can add footnotes <sup><a href="#fn__1" name="fnt__1" id="fnt__1" class="fn_top">1)</a></sup> by using double parentheses.
 
 </p>
@@ -212,7 +194,6 @@
 <div class="level2">
 
 <p>
-
 You can use up to five different levels of headlines to structure your content. If you have more than three headlines, a table of contents is generated automatically – this can be disabled by including the string <code>~~NOTOC~~</code> in the document.
 </p>
 
@@ -235,7 +216,6 @@
 == Headline Level 5 ==</pre>
 
 <p>
-
 By using four or more dashes, you can make a horizontal line:
 
 </p>
@@ -247,7 +227,6 @@
 <div class="level2">
 
 <p>
-
 You can include external and internal <a href="http://www.dokuwiki.org/images" class="interwiki iw_doku" title="http://www.dokuwiki.org/images">images</a> with curly brackets. Optionally you can specify the size of them.
 </p>
 
@@ -293,7 +272,6 @@
 {{ wiki:dokuwiki-128.png }}</pre>
 
 <p>
-
 Of course, you can add a title (displayed as a tooltip by most browsers), too.
 </p>
 
@@ -304,7 +282,6 @@
 <pre class="code">{{ wiki:dokuwiki-128.png |This is the caption}}</pre>
 
 <p>
-
 If you specify a filename (external or internal) that is not an image (<code>gif, jpeg, png</code>), then it will be displayed as a link instead.
 </p>
 
@@ -318,7 +295,6 @@
 <div class="level2">
 
 <p>
-
 Dokuwiki supports ordered and unordered lists. To create a list item, indent your text by two spaces and use a <code>*</code> for unordered lists or a <code>-</code> for ordered ones.
 
 </p>
@@ -366,7 +342,6 @@
 <div class="level2">
 
 <p>
-
 DokuWiki can convert certain pre-defined characters or strings into images or other text or <acronym title="HyperText Markup Language">HTML</acronym>.
 </p>
 
@@ -380,7 +355,6 @@
 <div class="level3">
 
 <p>
-
 DokuWiki converts commonly used <a href="http://en.wikipedia.org/wiki/emoticon" class="interwiki iw_wp" title="http://en.wikipedia.org/wiki/emoticon">emoticon</a>s to their graphical equivalents. Those <a href="http://www.dokuwiki.org/Smileys" class="interwiki iw_doku" title="http://www.dokuwiki.org/Smileys">Smileys</a> and other images can be configured and extended. Here is an overview of Smileys included in DokuWiki:
 
 </p>
@@ -433,7 +407,6 @@
 <div class="level3">
 
 <p>
-
 Typography: <a href="/dws/wiki/dokuwiki" class="wikilink1" title="wiki:dokuwiki">DokuWiki</a> can convert simple text characters to their typographically correct entities. Here is an example of recognized characters.
 </p>
 
@@ -458,7 +431,6 @@
 <div class="level2">
 
 <p>
-
 Some times you want to mark some text to show it&#039;s a reply or comment. You can use the following syntax:
 
 </p>
@@ -475,7 +447,6 @@
 &gt;&gt;&gt; Then lets do it!</pre>
 
 <p>
-
 I think we should do it
 
 </p>
@@ -504,7 +475,6 @@
 <div class="level2">
 
 <p>
-
 DokuWiki supports a simple syntax to create tables.
 
 </p>
@@ -524,7 +494,6 @@
 </table></div>
 <!-- EDIT19 TABLE [10198-10429] -->
 <p>
-
 Table rows have to start and end with a <code>|</code> for normal rows or a <code>^</code> for headers.
 
 </p>
@@ -534,7 +503,6 @@
 | Row 3 Col 1    | Row 3 Col 2     | Row 3 Col 3        |</pre>
 
 <p>
-
 To connect cells horizontally, just make the next cell completely empty as shown above. Be sure to have always the same amount of cell separators!
 </p>
 
@@ -558,7 +526,6 @@
 </table></div>
 <!-- EDIT20 TABLE [10949-11192] -->
 <p>
-
 As you can see, it&#039;s the cell separator before a cell which decides about the formatting:
 
 </p>
@@ -568,7 +535,6 @@
 ^ Heading 5    | Row 2 Col 2          | Row 2 Col 3        |</pre>
 
 <p>
-
 You can have rowspans (vertically connected cells) by adding <code>:::</code> into the cells below the one to which they should connect.
 
 </p>
@@ -588,7 +554,6 @@
 </table></div>
 <!-- EDIT21 TABLE [11667-11942] -->
 <p>
-
 Apart from the rowspan syntax those cells should not contain anything else.
 
 </p>
@@ -598,7 +563,6 @@
 | Row 3 Col 1    | :::                        | Row 2 Col 3        |</pre>
 
 <p>
-
 You can align the table contents, too. Just add at least two whitespaces at the opposite end of your text: Add two spaces on the left to align right, two spaces on the right to align left and two spaces at least at both ends for centered text.
 
 </p>
@@ -618,7 +582,6 @@
 </table></div>
 <!-- EDIT22 TABLE [12551-12738] -->
 <p>
-
 This is how it looks in the source:
 
 </p>
@@ -628,7 +591,6 @@
 | xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx |</pre>
 
 <p>
-
 Note: Vertical alignment is not supported.
 </p>
 
@@ -638,7 +600,6 @@
 <div class="level2">
 
 <p>
-
 If you need to display text exactly like it is typed (without any formatting), enclose the area either with <code>&lt;nowiki&gt;</code> tags or even simpler, with double percent signs <code>%%</code>.
 </p>
 
@@ -660,7 +621,6 @@
 <div class="level2">
 
 <p>
-
 You can include code blocks into your documents by either indenting them by at least two spaces (like used for the previous examples) or by using the tags <code>&lt;code&gt;</code> or <code>&lt;file&gt;</code>.
 
 </p>
@@ -686,7 +646,6 @@
 <div class="level3">
 
 <p>
-
 <a href="/dws/wiki/dokuwiki" class="wikilink1" title="wiki:dokuwiki">DokuWiki</a> can highlight sourcecode, which makes it easier to read. It uses the <a href="http://qbnz.com/highlighter/" class="urlextern" target="_blank" title="http://qbnz.com/highlighter/"  rel="nofollow">GeSHi</a> Generic Syntax Highlighter – so any language supported by GeSHi is supported. The syntax is the same like in the code and file blocks in the previous section, but this time the name of the used language is inserted inside the tag. Eg. <code>&lt;code java&gt;</code> or <code>&lt;file java&gt;</code>.
 </p>
 <pre class="code java"><span class="co3">/**
@@ -709,7 +668,6 @@
 <div class="level3">
 
 <p>
-
 When you use the <code>&lt;code&gt;</code> or <code>&lt;file&gt;</code> syntax as above, you might want to make the shown code available for download as well. You can to this by specifying a file name after language code like this:
 </p>
 <pre class="code">&lt;file php myexample.php&gt;
@@ -730,7 +688,6 @@
 <div class="level2">
 
 <p>
-
 You can embed raw <acronym title="HyperText Markup Language">HTML</acronym> or <acronym title="Hypertext Preprocessor">PHP</acronym> code into your documents by using the <code>&lt;html&gt;</code> or <code>&lt;php&gt;</code> tags. (Use uppercase tags if you need to enclose block level elements.)
 </p>
 
@@ -810,7 +767,6 @@
 </table></div>
 <!-- EDIT29 TABLE [19005-19445] -->
 <p>
-
 The refresh period defaults to 4 hours. Any value below 10 minutes will be treated as 10 minutes. <a href="/dws/wiki/dokuwiki" class="wikilink1" title="wiki:dokuwiki">DokuWiki</a> will generally try to supply a cached version of a page, obviously this is inappropriate when the page contains dynamic external content. The parameter tells <a href="/dws/wiki/dokuwiki" class="wikilink1" title="wiki:dokuwiki">DokuWiki</a> to re-render the page if it is more than <em>refresh period</em> since the page was last rendered.
 </p>
 
@@ -826,7 +782,6 @@
 <div class="level2">
 
 <p>
-
 Some syntax influences how DokuWiki renders a page without creating any output it self. The following control macros are availble:
 
 </p>
@@ -848,7 +803,6 @@
 <div class="level2">
 
 <p>
-
 DokuWiki&#039;s syntax can be extended by <a href="http://www.dokuwiki.org/plugins" class="interwiki iw_doku" title="http://www.dokuwiki.org/plugins">Plugins</a>. How the installed plugins are used is described on their appropriate description pages. The following syntax plugins are available in this particular DokuWiki installation:
 </p>
 <ul><li><div class="li"><a href="http://wiki.splitbrain.org/plugin:addnewpage" class="urlextern" target="_blank" title="http://wiki.splitbrain.org/plugin:addnewpage"  rel="nofollow">addnewpage</a> <em>20/12/2006</em> 由 <a href="mailto:&#x69;&#x64;&#x6f;&#x40;&#x69;&#x64;&#x6f;&#x74;&#x65;&#x63;&#x68;&#x2e;&#x69;&#x6e;&#x66;&#x6f;" class="mail JSnocheck" title="&#x69;&#x64;&#x6f;&#x40;&#x69;&#x64;&#x6f;&#x74;&#x65;&#x63;&#x68;&#x2e;&#x69;&#x6e;&#x66;&#x6f;">iDo</a><br />This add a &quot;new page form&quot; in your page. \ Syntax : {{NEWPAGE[&gt;namespace]}}  where [&gt;namespace] is optional.</div></li><li><div class="li"><a href="http://www.dokuwiki.org/plugin:bbs" class="urlextern" target="_blank" title="http://www.dokuwiki.org/plugin:bbs"  rel="nofollow">BBS</a> <em>2011-01-23</em> 由 <a href="mailto:&#x64;&#x61;&#x6e;&#x6e;&#x79;&#x30;&#x38;&#x33;&#x38;&#x5b;&#x61;&#x74;&#x5d;&#x70;&#x63;&#x68;&#x6f;&#x6d;&#x65;&#x5b;&#x64;&#x6f;&#x74;&#x5d;&#x63;&#x6f;&#x6d;&#x5b;&#x64;&#x6f;&#x74;&#x5d;&#x74;&#x77;" class="mail JSnocheck" title="&#x64;&#x61;&#x6e;&#x6e;&#x79;&#x30;&#x38;&#x33;&#x38;&#x5b;&#x61;&#x74;&#x5d;&#x70;&#x63;&#x68;&#x6f;&#x6d;&#x65;&#x5b;&#x64;&#x6f;&#x74;&#x5d;&#x63;&#x6f;&#x6d;&#x5b;&#x64;&#x6f;&#x74;&#x5d;&#x74;&#x77;">Danny Lin</a><br />&lt;bbs&gt; tag that creates a block for BBS text.</div></li><li><div class="li"><a href="http://www.dokuwiki.org/plugin:folded" class="urlextern" target="_blank" title="http://www.dokuwiki.org/plugin:folded"  rel="nofollow">Folded Plugin – Inline</a> <em>2008-08-13</em> 由 <a href="mailto:&#x77;&#x65;&#x62;&#x6d;&#x61;&#x73;&#x74;&#x65;&#x72;&#x40;&#x6c;&#x61;&#x6a;&#x7a;&#x61;&#x72;&#x2e;&#x63;&#x6f;&#x2e;&#x75;&#x6b;" class="mail JSnocheck" title="&#x77;&#x65;&#x62;&#x6d;&#x61;&#x73;&#x74;&#x65;&#x72;&#x40;&#x6c;&#x61;&#x6a;&#x7a;&#x61;&#x72;&#x2e;&#x63;&#x6f;&#x2e;&#x75;&#x6b;">Fabian van-de-l_Isle</a><br />Enable inline folded text. <br />                         Syntax: ++title|folded content++</div></li><li><div class="li"><a href="http://wiki.splitbrain.org/plugin:html_comment" class="urlextern" target="_blank" title="http://wiki.splitbrain.org/plugin:html_comment"  rel="nofollow">HTML Comment Plugin</a> <em>2005-10-08</em> 由 <a href="mailto:&#x63;&#x68;&#x72;&#x69;&#x73;&#x40;&#x63;&#x68;&#x72;&#x69;&#x73;&#x61;&#x72;&#x6e;&#x64;&#x74;&#x2e;&#x64;&#x65;" class="mail JSnocheck" title="&#x63;&#x68;&#x72;&#x69;&#x73;&#x40;&#x63;&#x68;&#x72;&#x69;&#x73;&#x61;&#x72;&#x6e;&#x64;&#x74;&#x2e;&#x64;&#x65;">Christopher Arndt</a><br />allows HTML comments to be retained in the output</div></li><li><div class="li"><a href="http://www.dokuwiki.org/plugin:htmlsafe" class="urlextern" target="_blank" title="http://www.dokuwiki.org/plugin:htmlsafe"  rel="nofollow">HTML Safe</a> <em>2010-12-22</em> 由 <a href="mailto:&#x64;&#x61;&#x6e;&#x6e;&#x79;&#x30;&#x38;&#x33;&#x38;&#x40;&#x70;&#x63;&#x68;&#x6f;&#x6d;&#x65;&#x2e;&#x63;&#x6f;&#x6d;&#x2e;&#x74;&#x77;" class="mail JSnocheck" title="&#x64;&#x61;&#x6e;&#x6e;&#x79;&#x30;&#x38;&#x33;&#x38;&#x40;&#x70;&#x63;&#x68;&#x6f;&#x6d;&#x65;&#x2e;&#x63;&#x6f;&#x6d;&#x2e;&#x74;&#x77;">Danny Lin</a><br />Allows &lt;html&gt; tag usage with security concerned markups excluded</div></li><li><div class="li"><a href="http://dokuwiki.org/plugin:include" class="urlextern" target="_blank" title="http://dokuwiki.org/plugin:include"  rel="nofollow">Include Plugin</a> <em></em> 由 <a href="mailto:&#x64;&#x6f;&#x6b;&#x75;&#x77;&#x69;&#x6b;&#x69;&#x40;&#x63;&#x68;&#x69;&#x6d;&#x65;&#x72;&#x69;&#x63;&#x2e;&#x64;&#x65;" class="mail JSnocheck" title="&#x64;&#x6f;&#x6b;&#x75;&#x77;&#x69;&#x6b;&#x69;&#x40;&#x63;&#x68;&#x69;&#x6d;&#x65;&#x72;&#x69;&#x63;&#x2e;&#x64;&#x65;">Gina Häußge, Michael Klier, Esther Brunner</a><br />Displays a wiki page (or a section thereof) within another</div></li><li><div class="li"><a href="http://dokuwiki.org/plugin:info" class="urlextern" target="_blank" title="http://dokuwiki.org/plugin:info"  rel="nofollow">Info Plugin</a> <em>2008-09-12</em> 由 <a href="mailto:&#x61;&#x6e;&#x64;&#x69;&#x40;&#x73;&#x70;&#x6c;&#x69;&#x74;&#x62;&#x72;&#x61;&#x69;&#x6e;&#x2e;&#x6f;&#x72;&#x67;" class="mail JSnocheck" title="&#x61;&#x6e;&#x64;&#x69;&#x40;&#x73;&#x70;&#x6c;&#x69;&#x74;&#x62;&#x72;&#x61;&#x69;&#x6e;&#x2e;&#x6f;&#x72;&#x67;">Andreas Gohr</a><br />Displays information about various DokuWiki internals</div></li><li><div class="li"><a href="http://www.dokuwiki.org/plugin:odt" class="urlextern" target="_blank" title="http://www.dokuwiki.org/plugin:odt"  rel="nofollow">Open Document Plugin</a> <em>2010-10-30</em> 由 <a href="mailto:&#x61;&#x6e;&#x64;&#x69;&#x40;&#x73;&#x70;&#x6c;&#x69;&#x74;&#x62;&#x72;&#x61;&#x69;&#x6e;&#x2e;&#x6f;&#x72;&#x67;&#x2c;&#x20;&#x61;&#x75;&#x72;&#x65;&#x6c;&#x69;&#x65;&#x6e;&#x40;&#x62;&#x6f;&#x6d;&#x70;&#x61;&#x72;&#x64;&#x2e;&#x6f;&#x72;&#x67;" class="mail JSnocheck" title="&#x61;&#x6e;&#x64;&#x69;&#x40;&#x73;&#x70;&#x6c;&#x69;&#x74;&#x62;&#x72;&#x61;&#x69;&#x6e;&#x2e;&#x6f;&#x72;&#x67;&#x2c;&#x20;&#x61;&#x75;&#x72;&#x65;&#x6c;&#x69;&#x65;&#x6e;&#x40;&#x62;&#x6f;&#x6d;&#x70;&#x61;&#x72;&#x64;&#x2e;&#x6f;&#x72;&#x67;">Andreas Gohr, Aurelien Bompard</a><br />Export the current Wiki page to a OpenOffice ODT file</div></li><li><div class="li"><a href="http://dokuwiki.org/plugin:pagelist" class="urlextern" target="_blank" title="http://dokuwiki.org/plugin:pagelist"  rel="nofollow">Pagelist Plugin</a> <em>2010-01-07</em> 由 <a href="mailto:&#x64;&#x6f;&#x6b;&#x75;&#x77;&#x69;&#x6b;&#x69;&#x40;&#x63;&#x68;&#x69;&#x6d;&#x65;&#x72;&#x69;&#x63;&#x2e;&#x64;&#x65;" class="mail JSnocheck" title="&#x64;&#x6f;&#x6b;&#x75;&#x77;&#x69;&#x6b;&#x69;&#x40;&#x63;&#x68;&#x69;&#x6d;&#x65;&#x72;&#x69;&#x63;&#x2e;&#x64;&#x65;">Gina Häußge, Michael Klier</a><br />Lists pages in a nice looking table or unordered list.</div></li><li><div class="li"><a href="http://wiki.splitbrain.org/plugin:page_redirector" class="urlextern" target="_blank" title="http://wiki.splitbrain.org/plugin:page_redirector"  rel="nofollow">Page Redirect</a> <em>2007-01-24</em> 由 <a href="mailto:&#x7a;&#x79;&#x62;&#x65;&#x72;&#x64;&#x6f;&#x67;&#x40;&#x71;&#x75;&#x61;&#x6b;&#x65;&#x6e;&#x65;&#x74;&#x2e;&#x6f;&#x72;&#x67;" class="mail JSnocheck" title="&#x7a;&#x79;&#x62;&#x65;&#x72;&#x64;&#x6f;&#x67;&#x40;&#x71;&#x75;&#x61;&#x6b;&#x65;&#x6e;&#x65;&#x74;&#x2e;&#x6f;&#x72;&#x67;">David Lorentsen</a><br />Redirects page requests based on content</div></li><li><div class="li"><a href="http://www.dokuwiki.org/plugin:plaintext" class="urlextern" target="_blank" title="http://www.dokuwiki.org/plugin:plaintext"  rel="nofollow">Plain Text</a> <em>2011-01-23</em> 由 <a href="mailto:&#x64;&#x61;&#x6e;&#x6e;&#x79;&#x30;&#x38;&#x33;&#x38;&#x5b;&#x61;&#x74;&#x5d;&#x70;&#x63;&#x68;&#x6f;&#x6d;&#x65;&#x5b;&#x64;&#x6f;&#x74;&#x5d;&#x63;&#x6f;&#x6d;&#x5b;&#x64;&#x6f;&#x74;&#x5d;&#x74;&#x77;" class="mail JSnocheck" title="&#x64;&#x61;&#x6e;&#x6e;&#x79;&#x30;&#x38;&#x33;&#x38;&#x5b;&#x61;&#x74;&#x5d;&#x70;&#x63;&#x68;&#x6f;&#x6d;&#x65;&#x5b;&#x64;&#x6f;&#x74;&#x5d;&#x63;&#x6f;&#x6d;&#x5b;&#x64;&#x6f;&#x74;&#x5d;&#x74;&#x77;">Danny Lin</a><br />&lt;text&gt; and &lt;TEXT&gt; tags that embeds plain text with linebreaks and auto wrap.</div></li><li><div class="li"><a href="http://www.dokuwiki.org/plugin:s5" class="urlextern" target="_blank" title="http://www.dokuwiki.org/plugin:s5"  rel="nofollow">S5 Slideshow Plugin</a> <em>2009-01-07</em> 由 <a href="mailto:&#x61;&#x6e;&#x64;&#x69;&#x40;&#x73;&#x70;&#x6c;&#x69;&#x74;&#x62;&#x72;&#x61;&#x69;&#x6e;&#x2e;&#x6f;&#x72;&#x67;" class="mail JSnocheck" title="&#x61;&#x6e;&#x64;&#x69;&#x40;&#x73;&#x70;&#x6c;&#x69;&#x74;&#x62;&#x72;&#x61;&#x69;&#x6e;&#x2e;&#x6f;&#x72;&#x67;">Andreas Gohr</a><br />Display a Wiki page as S5 slideshow presentation</div></li><li><div class="li"><a href="http://www.dokuwiki.org/plugin:tag" class="urlextern" target="_blank" title="http://www.dokuwiki.org/plugin:tag"  rel="nofollow">Tag Plugin (topic component)</a> <em></em> 由 <a href="mailto:&#x64;&#x6f;&#x6b;&#x75;&#x77;&#x69;&#x6b;&#x69;&#x40;&#x63;&#x68;&#x69;&#x6d;&#x65;&#x72;&#x69;&#x63;&#x2e;&#x64;&#x65;" class="mail JSnocheck" title="&#x64;&#x6f;&#x6b;&#x75;&#x77;&#x69;&#x6b;&#x69;&#x40;&#x63;&#x68;&#x69;&#x6d;&#x65;&#x72;&#x69;&#x63;&#x2e;&#x64;&#x65;">Gina Häußge, Michael Klier, Esther Brunner</a><br />Displays a list of wiki pages with a given category tag</div></li><li><div class="li"><a href="http://dokuwiki.org/plugin:wrap" class="urlextern" target="_blank" title="http://dokuwiki.org/plugin:wrap"  rel="nofollow">Wrap Plugin</a> <em>2010-11-20</em> 由 <a href="mailto:&#x61;&#x6e;&#x69;&#x6b;&#x61;&#x40;&#x73;&#x65;&#x6c;&#x66;&#x74;&#x68;&#x69;&#x6e;&#x6b;&#x65;&#x72;&#x2e;&#x6f;&#x72;&#x67;" class="mail JSnocheck" title="&#x61;&#x6e;&#x69;&#x6b;&#x61;&#x40;&#x73;&#x65;&#x6c;&#x66;&#x74;&#x68;&#x69;&#x6e;&#x6b;&#x65;&#x72;&#x2e;&#x6f;&#x72;&#x67;">Anika Henke</a><br />Universal plugin which combines functionalities of many other plugins. Wrap wiki text inside containers (divs or spans) and give them a class (choose from a variety of preset classes), a width and/or a language with its associated text direction.</div></li></ul>

Both of above are no difference except for the first linebreak after paragraph open.

danny0838danny0838

2011/01/23 08:41

Redundant End-of-paragraph Linebreaks

The above fix doesn't solve another problem - redundant end-of-paragraph linebreaks.

You can see that in the demo page, there are extra linebreaks at the end of block before a table, quote, or list block. This is due to matching of, for example, “\n\^” for table start.

This is still a problem but is not so severe since the ending <br/> in a <p> (if xbr plugin installed) is always not shown in the browser.

danny0838danny0838

2011/01/23 08:41

devel/rewriteblocks.txt · Last modified: 2011/01/23 08:42 by danny0838
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Imprint Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
WikiForumIRCBugsGitXRefTranslate