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

Enter your recipe's description here.

>><< (:div:)(:divend:) by default have to close on a different line. This shows how to do it on the same line.

Installation

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") ;
}

Configuration

Internationalization

The following strings can be translated in an XLPage:

Usage

Notes

This code snippet/HowTo/addon/cookbook/recipe created from PmWiki Talk page https://www.pmwiki.org/wiki/PmWiki/WikiStyles-Talk section "Block on the same line?"

To do / some day / maybe

If you have future plans or wishes for this recipe.

Change log / Release notes

If the recipe has multiple releases, then release notes can be placed here. Note that it's often easier for people to work with "release dates" instead of "version numbers".

See also

Contributors

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.