CloseBlockOnSameLine

Summary: close block on same line
Version: 1.0
Prerequisites: none
Status: working
Maintainer: gnuzoo
License: GPL
Categories: Uncategorized
Users: (view / edit)

Questions answered by this recipe

How to close a block on the same line

All sections are optional, you can remove those that do not apply to your recipe, and add new ones.

Description

PmWiki markups for >><< and (:div:)(:divend:) by default have to close on a different line.
This allows you to do it on the same line.

Installation

No file(s) to download.

Just copy this PHP code to your config.php or your farmconfig.php:

switch ($action) {
        case "edit"   :
                if (! @$_POST['preview']) break ;
        case "browse" :
        case "print"  :
                Markup('CloseBlockOnSameLine1', '_begin', '/(\\(:div.*?:\\))(.*?)(\\(:divend:\\))$/i', "$1$2\n$3") ;
                Markup('CloseBlockOnSameLine2', '_begin', '/^(&gt;&gt;.+?&lt;&lt;)(.*?)(&gt;&gt;&lt;&lt;)$/', "$1$2\n$3") ;
                Markup('CloseBlockOnSameLine3', '_begin', '/(\\(:details.*?:\\))(.*?)(\\(:detailsend:\\))$/i', "$1$2\n$3") ;
}

Notes

This code snippet/HowTo/addon/cookbook/recipe created from PmWiki Talk page WikiStyles-Talk section "Block on the same line?"

Comments

See discussion at CloseBlockOnSameLine-Talk

User notes : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.