Missing end tag for preformatted text

Bug #855634 reported by Yves Piguet
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Nyctergatis Markup Engine
Fix Released
Medium
Yves Piguet

Bug Description

Preformatted text (text starting with a triple-brace "{{{") doesn't produce a closing tag (no "</pre>" in html).

Revision history for this message
r (ralfjunker) wrote :

Works well for me. This Creole:

before
{{{
this is preformatted
}}}
after

outputs this HTML:

<html>
<body>
<p>before</p>
<pre>
this is preformatted
</pre>
<p>after</p>
</body>
</html>

Revision history for this message
Yves Piguet (yves-piguet) wrote :

Sorry, the initial description wasn't detailed enough. It's when the closing braces are missing that the end tag in the output is missing. Try for instance

{{{
foo

The following patch fixes the bug:

=== modified file 'Src/NME.c'
--- Src/NME.c 2011-01-27 23:32:24 +0000
+++ Src/NME.c 2011-09-26 09:03:52 +0000
@@ -2960,9 +2960,7 @@
      case kNMETokenPre:
       HOOK(parHookFun, kNMEHookLevelPar, 0, TRUE, "{{{");
       if (!NMEAddString(outputFormat->beginPre, -1,
- context.ctrlChar, &context)
- || !NMEAddString(outputFormat->beginPreLine, -1,
- context.ctrlChar, &context))
+ context.ctrlChar, &context))
        return kNMEErrNotEnoughMemory;
       state = kNMEStatePreAfterEol;
       // skip next eol
@@ -3957,6 +3955,14 @@
    CheckError(addEndPar(TRUE, outputFormat, &context));
    break;
   case kNMEStatePre:
+ if (!NMEAddString(outputFormat->endPreLine, -1,
+ context.ctrlChar, &context)
+ || !NMEAddString(outputFormat->endPre, -1,
+ context.ctrlChar, &context))
+ return kNMEErrNotEnoughMemory;
+ HOOK(parHookFun, kNMEHookLevelPar, 0, FALSE, "{{{");
+ break;
+ case kNMEStatePreAfterEol:
    if (!NMEAddString(outputFormat->endPre, -1,
      context.ctrlChar, &context))
     return kNMEErrNotEnoughMemory;

Changed in nme:
status: New → Fix Committed
Changed in nme:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.