I'd like to propose the following logic for handling this element:
- If the first brace is on the first column, and there are no non-whitespace characters after the last brace, then this element starts a block-level element.
- Otherwise, start a <span>.
The point is that I've found that my users often want to escape markup within a sentence, and the above rules seem to work well in that case.
Whether there is whitespace before the first brace is a matter of taste, I believe.
-- Janne Jalkanen, 31-Aug-2006
like this?
this is an example {{ ==h1, **bold** }} that starts a span and this is an example as a block for sourcecode {{ println 'hello world'; }}
This way we would not need seperate syntaxes for monospaced and preformatted
-- Christoph, 31-Aug-2006
Well, monospace is different from preformatted which is different from monowiki. But essentially, yes.
I agree with Janne. I'd phrase the rules differently, however:
- If the opening triple braces start on the first column, open a pre block. It is closed by closing triple braces starting on the first column.
- Any other opening triple braces open a span. They are closed by tripple braces.
This has the benefit that you can include the markup for unprocessed text inside the markup for preformatted text. Something I have wanted to do on this wiki several times!
The desired result is:
To produce bold text, use {{{**bold**}}}.
And not:
To produce bold text, use {{{**bold**}}}.
Collision with MediaWiki format parameters#
Unfortunately {{{..}}} for preformatted text collides with MediaWiki template parameters, see Creole Markup Collision Analysis. Since MediaWiki is probably the most popular wiki of all this needs to be changed.
-- MartinBudden, 2006-12-28
So a single wiki engine uses markup conflicting with Creole for a feature pretty unique for it. That's unfortunate. What can we do?
Update: After some reaserach on MediaWiki's templates, I think it's not that bad at all:
- Normal (non-template) pages can use monospaced text without problems
- Template pages can use the preformatted blocks normally
- Template pages can render inline {{{...}} } }}} as nowiki text by default, with two exceptions: ** When there is only a number inside, and the page is being included as a template with at least that number of paramteres ** When there is a parameter name inside, and the page is being included as a template with that named parameter passed It has two disadvantages: * makes it harder to explain/understand the creating of templates -- but they are pretty advanced and rare feature anyways * makes it a little harder to write (and maintain) the parser -- but that's something you do for a single wiki engine -- and at its cost you have a pretty popular and collision-free syntax in Creole. It's not me who is going to do that work, but I think it's worth it. ** RadomirDopieralski, 2006-12-29 Radomir, I agree with your comments: * the use of triple braces for preformatted text complicates the MediaWiki parser, but it is possible * writing templates is already a specialized skill I've changed the collision to a partial collision. -- MartinBudden, 2007-01-01 Discussion on escaping moved to [Talk.AddNoWikiEscapeProposal] ---- I note that the current draft has support for preformatted (monospace and unformatted) text, but not simply unformatted text. One of the cleanup items I need to do for [Ghestalt] markup is to back out my current C-like backslash syntax for escaping wiki metacharacters and implement the double-backslash linebreak. I'll miss the loss of a mechanism to implement unformatted text containing metacharacters. I find we've used the backslash quite a bit. One possibility I'm considering (maybe as an extension) is to adapt the exclamation prefix traditionally used for making CamelCase words nowiki. In Creole style, I'd adapt that to a double exclamation point. It needs to occur at the beginning of a word (delimited by whitespace) to be interpreted. Its scope would be to the end of the word (again delimited by whitespace), and would suppress all interpretation of metacharacters within that scope. So, for example, if you want double backslash instead of linebreak, you could write {{{!!\\}}}. And to write markup that will produce that display, you'd write {{{!!!!\\}}}. Of course I'm allowed to do this in the spirit of ExtensibleByOmission, but I'm wondering if there's sense this kind of functionality would be generally useful, either as a proposal for the core, or possibly as a "gently suggested" extension. P.S. I want to take this opportunity to rant against the word "nowiki". I see it used here primarily as a synonym for preformatted (i.e. unformatted and monospaced), but its original usage was to defeat automatic link pattern detection, without the accompanying switch to monospace font. Thus, it seems nearly impossible to use the term without creating potential confusion about which is meant. I recommend we try to consistently use the terms "monospaced" and "unformatted" to refer to the components, and "preformatted" to refer to the combination. -- [Raph Levien] 2002-02-10 I used "nowiki" to mean "unformatted, not monospaced text". Personally, I'd like to see {{{{{{foo}}}}}} in this role, and then {{{##foo##}}} as the "unformatted, monospaced" text in Creole Extended. In the absence of that markup, {{{{{{foo}}}}}} can produce monospaced text, if it's desirable on particular wiki. This is not as important for inline markup -- you can't line up characters anyways, because you don't know the line length. So changing the font from monospace to normal or the other way around is not going to mess things. There are several reasons why I'm advocating "#" for marking up inline monospaced text: * it's the most popular markup that is acceptable in Creole [listed at wikimatrix|http://www.wikimatrix.org/syntax.php?i=26], * it's used mostly for variables, snippets of code, etc. -- great number of programming languages use "#" as a comment character, and comments are unlikely to appear in these snippets, * it mirrors the markup used for bold, so we can use all the same rules and techniques used for lists/bold, * it has no other obvious use, * it looks good (to me). What do you think? -- RadomirDopieralski, 2007-02-10 I don't understand very well what it adds wrt corrent "nowiki". Nowiki now serves for monospaced sequences, and it leaves the content unparsed, which I think is correct and desirable. Mixing monospace and other markup... I'm not sure. The only "problem" is when you want to escape some markup, for example introducing a sequence of asterisks in text, without producing monospaced output. But for this purpose an [Escape Character] is more appropriate, IMO. It'd be necessary, anyway. Now that we're using "\" for forced linebreaks, we could use it as an escape char as well. -- [Michele Tomaiuolo], 2007-02-11