Description

The text/html formatter has problem generating valid html code for blockquotes with multiple paragraphs in it.

Steps to reproduce

  1. In your parser (or macro or action or anything) use something like this to generate html:

   1 # correct code for moin--refactor--1.5--current (will be in 1.5.2)
   2 def execute(macro, args):
   3     formatter = macro.formatter
   4     html = ''.join([
   5     formatter._open('blockquote'),
   6     formatter.paragraph(1),
   7     formatter.text('foo'),
   8     formatter.paragraph(0),
   9     formatter.paragraph(1),
  10     formatter.text('bar'),
  11     formatter.paragraph(0),
  12     formatter._close('blockquote')
  13     ])
  14     return html
  1. This will produce output like this:

foo

bar

Which definitely is not valid html.

Example

No exmaple.

Details

MoinMoin Version

1.5.0

OS and Version

PLD Linux

Python Version

2.4.2

Server Setup

cgi

Server Details

apache

Workaround

Use this code instead:

   1 request.write(''.join([
   2     formatter.rawHTML('<blockquote>'),
   3     formatter.open('p'),
   4     formatter.text('foo'),
   5     formatter.close('p'),
   6     formatter.open('p'),
   7     formatter.text('bar'),
   8     formatter.close('p'),
   9     formatter.close('blockquote')
  10 ]))

Discussion

The HTML 4.0 DTD doesn't allow to put text in <blockquote> without enclosing tags, like <p>.

Btw: You should not diredctly use the .open() and .close() methods of the (text/html) formatter. They are for internal use only and are not supported by other formatters! (May be we should rename them to ._open and ._close()) Nevertheless this is a bug.

Plan


CategoryMoinMoinBugFixed

MoinMoin: MoinMoinBugs/FormatterBreaksBlockquotesWithMultipleParagraphs (last edited 2007-10-29 19:17:44 by localhost)