Pdf rendering 'bug' for multiline <blockquote>

6 views
Skip to first unread message

Bjoern

unread,
Feb 23, 2009, 3:52:17 PM2/23/09
to mwlib
Dear all,

I've got a problem with rendering multiline <blockquotes>. In
principle the following mediawiki text results in the desired result:

<blockquote>
line 1

line 2
</blockquote>

but when this is rendered to pdf, only the 2nd line is blockquoted.
Plenty of examples for the various behaviours here:
http://www.ict4e.net/wiki/Collection/issues

Does anybody have a work around for doing a multi-line indentation?
(Using div, or blockquote? I'd like to avoid a table,
though this would presumably work.)

Bjoern

Bjoern

unread,
Feb 24, 2009, 12:11:52 PM2/24/09
to mwlib
Dear all,

my original post may well be related to
http://code.pediapress.com/wiki/ticket/305
http://code.pediapress.com/wiki/ticket/41
from about 5-6 months ago, both of which are marked as 'fixed'.

Should this have made it into the public render server yet? If not, is
there a way to test this (other than installing the dev version
myself)?
(I've put the same mediawiki text here: http://simple.pediapress.com/w/index.php/User:Bjoern
, with the same results.)

Any help or tips would be greatly appreciated!

Many thanks,
Bjoern

Ralf Schmitt

unread,
Feb 25, 2009, 7:25:56 AM2/25/09
to mw...@googlegroups.com
On Mon, Feb 23, 2009 at 9:52 PM, Bjoern <sl.co...@googlemail.com> wrote:
>
> Dear all,
>
> I've got a problem with rendering multiline <blockquotes>. In
> principle the following mediawiki text results in the desired result:
>
> <blockquote>
> line 1
>
> line 2
> </blockquote>
>
> but when this is rendered to pdf, only the 2nd line is blockquoted.

this seems to work for me using the latest mwlib/mwlib.rl (i.e. it
produces a blockquoted "line1 line 2", just like my mediawiki
installation does...


> Plenty of examples for the various behaviours here:
> http://www.ict4e.net/wiki/Collection/issues
>

It look like our tree cleaner code moves the paragraph nodes to the
outer paragraph:

In [3]: uparser.simpleparse("<blockquote><div>bla\n\nblubb</div></blockquote>")
2009-02-25T13:22:09 parser.info >> Parsing "'unknown'"
Article 'unknown': 1 children
Paragraph '': 1 children
Style '-': 1 children
TagNode u'div': 2 children
Paragraph '': 1 children
u'bla'
Node '': 1 children
u'blubb'

Volker?

Regards,
- Ralf

Volker Haas

unread,
Feb 25, 2009, 8:38:55 AM2/25/09
to mw...@googlegroups.com

Actually the treecleaner has nothing to do with the problem. There was a
bug in mwlib.rl which is fixed now.

But the handling of multi-paragraph blockquotes in mwlib.rl is a bit
awkward. To be precise the current solution is a little hackish: the
output is not a real blockquote but only left indented , the right
indentation of a "real" blockquote is missing. I hope this is not a problem.

Bjoern, why do you use multi-paragraph blockquotes anyway? Why not use
multiple single-paragraph blockquotes?

--
volker haas brainbot technologies ag
fon +49 6131 2116394 boppstraße 64
fax +49 6131 2116392 55118 mainz
volke...@brainbot.com http://www.brainbot.com/

Bjoern

unread,
Feb 25, 2009, 6:06:22 PM2/25/09
to mwlib
Hi Ralf, hi Volker,

thanks for the responses, and good to hear that a fix is available.

Is there a public version of the latest mwlib.rl, that I could point
my Extension at? Or would I actually have to install the code from
source to test?

> But the handling of multi-paragraph blockquotes in mwlib.rl is a bit
> awkward. To be precise the current solution is a little hackish: the
> output is not a real blockquote but only left indented , the right
> indentation of a "real" blockquote is missing. I hope this is not a problem.

That would be ok for me, especially if background colour is preserved
(see above examples), which would allow to distinguish quoted text
further.

> Bjoern, why do you use multi-paragraph blockquotes anyway? Why not use
> multiple single-paragraph blockquotes?

I'm logging a discussion from an email list to a mediawiki. It's quite
easy to insert a {{quote| ... }} and then paste the email text, which
might contain multiple paragraphs, as well as lists and other wiki
markup. It's quite awkward to have to insert a {{quote|...}} around
every paragraph. Also, it's quite good to have the {{quote| ...}}
around contiguous paragraphs from the same email, to distinguish (at
least in the wiki markup) when new emails start.

Thanks,
Bjoern

Volker Haas

unread,
Feb 26, 2009, 5:17:06 AM2/26/09
to mw...@googlegroups.com

Bjoern wrote:
> Hi Ralf, hi Volker,
>
> thanks for the responses, and good to hear that a fix is available.
>
> Is there a public version of the latest mwlib.rl, that I could point
> my Extension at? Or would I actually have to install the code from
> source to test?
>
>

I haven't built a new release of mwlib.rl so you have to install from
source or wait a couple of days. Installing from source is not
difficult, you need to install mercurial (version control software) and
check out the source. Instructions can be found at
http://code.pediapress.com/wiki/wiki/mwlib-install (note: instructions
are for mwlib -> installing mwlib.rl pretty much only requires to
replace mwlib by mwlib.rl)


>> But the handling of multi-paragraph blockquotes in mwlib.rl is a bit
>> awkward. To be precise the current solution is a little hackish: the
>> output is not a real blockquote but only left indented , the right
>> indentation of a "real" blockquote is missing. I hope this is not a problem.
>>
>
> That would be ok for me, especially if background colour is preserved
> (see above examples), which would allow to distinguish quoted text
> further.
>

I forgot to mention that an unpleasant surprise is waiting for you
there. The coloring in your examples was not handled correctly by
mwlib.rl. Coloring multiple paragraphs with a solid background color is
not possible right now.

I fear currently the only solution with which you will be able to
achieve what you want is to use tables. I know it's ugly by I don't have
a better idea currently. You also have to make sure that the table has
more than just a single column b/c these tables are removed (content is
kept).


>
>> Bjoern, why do you use multi-paragraph blockquotes anyway? Why not use
>> multiple single-paragraph blockquotes?
>>
>
> I'm logging a discussion from an email list to a mediawiki. It's quite
> easy to insert a {{quote| ... }} and then paste the email text, which
> might contain multiple paragraphs, as well as lists and other wiki
> markup. It's quite awkward to have to insert a {{quote|...}} around
> every paragraph. Also, it's quite good to have the {{quote| ...}}
> around contiguous paragraphs from the same email, to distinguish (at
> least in the wiki markup) when new emails start.
>
>

Ok, this makes sense.

Regards,
Volker

Bjoern

unread,
Feb 26, 2009, 6:27:07 AM2/26/09
to mwlib
Hi Volker,

> I haven't built a new release of mwlib.rl so you have to install from
> source or wait a couple of days. Installing from source is not

That sounds fine - I'll try again in a few days!

> > That would be ok for me, especially if background colour is preserved
> > (see above examples), which would allow to distinguish quoted text
> > further.
>
> I forgot to mention that an unpleasant surprise is waiting for you
> there. The coloring in your examples was not handled correctly by
> mwlib.rl. Coloring multiple paragraphs with a solid background color is
> not possible right now.

The colour isn't essential, but I'd like to give the blockquote
another attribute to distinguish it from the main flow of the text.
Would other attributes of the div (such as italic font), or an <i> tag
around the whole contents of the blockquote be handled correctly?

Many thanks for the suggestions and help!
Bjoern

Volker Haas

unread,
Feb 26, 2009, 6:36:45 AM2/26/09
to mw...@googlegroups.com

Bjoern wrote:
>
>
> The colour isn't essential, but I'd like to give the blockquote
> another attribute to distinguish it from the main flow of the text.
> Would other attributes of the div (such as italic font), or an <i> tag
> around the whole contents of the blockquote be handled correctly?
>
>

Using a <i> (or <em>) tag should do the trick. But I guess it would be
better to stick it inside the div if possible.

Bjoern

unread,
Feb 26, 2009, 7:37:12 AM2/26/09
to mwlib
That sounds good, thanks!
Bjoern

Bjoern

unread,
Mar 10, 2009, 9:28:02 AM3/10/09
to mwlib
Hi Volker,

I've now tested this, and the <blockquote><div> now works: All lines
are indented properly.

However, the <blockquote><div><i> doesn't work: Only the first
paragraph within the blockquote is italic.

Examples:
http://www.ict4e.net/wiki/Collection/issues
http://www.ict4e.net/wiki/File:Collection_Issue_1_new.png

Do you have any further suggestions on what I could do?

Many thanks!
Bjoern
> volker.h...@brainbot.com    http://www.brainbot.com/

Volker Haas

unread,
Mar 11, 2009, 5:41:48 AM3/11/09
to mw...@googlegroups.com
Hi Bjoern,

what you describe is caused by a bug. I opened a ticket for that
http://code.pediapress.com/wiki/ticket/514

The only real workaround that I can suggest is to style the paragraphs
separately - but judging from our previous discussions I fear this is
not possible in your case.

Currently I have no other ideas...

Regards,
Volker
volke...@brainbot.com http://www.brainbot.com/

Volker Haas

unread,
Mar 13, 2009, 6:29:45 AM3/13/09
to mw...@googlegroups.com
Bjoern,
the bug (#514) is now fixed, your code snippet should now work.

Regards,
Volker
volke...@brainbot.com http://www.brainbot.com/

sl contrib

unread,
Mar 16, 2009, 3:38:33 PM3/16/09
to mw...@googlegroups.com
Hi Volker,

just tested with this page, and unfortunately the italics still doesn't work.


Any further ideas what the problem could be?
All the best,
Bjoern

Volker Haas

unread,
Mar 17, 2009, 5:36:56 AM3/17/09
to mw...@googlegroups.com
Hi Bjoern,
my answer was a little misleading. The examples in the link below do
work (except when using the css font-style parameter) only in the
current trunk version. We have not yet build a new package but we'll do
so in about a week or so.

Regards,
Volker
> <mailto:volker.h...@brainbot.com>> wrote:
> >
> >> Bjoern wrote:
> >>
> >>
> >>> The colour isn't essential, but I'd like to give the blockquote
> >>> another attribute to distinguish it from the main flow of the
> text.
> >>> Would other attributes of the div (such as italic font), or an
> <i> tag
> >>> around the whole contents of the blockquote be handled correctly?
> >>>
> >> Using a <i> (or <em>) tag should do the trick. But I guess it
> would be
> >> better to stick it inside the div if possible.
> >>
> >>
> >>
> >> --
> >> volker haas brainbot technologies ag
> >> fon +49 6131 2116394 boppstraße 64
> >> fax +49 6131 2116392 55118 mainz
> >> volker.h...@brainbot.com <mailto:volker.h...@brainbot.com>
> http://www.brainbot.com/
> >>
> > >
> >
>
> --
> volker haas brainbot technologies ag
> fon +49 6131 2116394 boppstraße 64
> fax +49 6131 2116392 55118 mainz
> volke...@brainbot.com <mailto:volke...@brainbot.com>

Bjoern

unread,
Mar 18, 2009, 6:50:10 AM3/18/09
to mwlib
Hi Volker,

excellent - thanks!

Bjoern
> volker.h...@brainbot.com    http://www.brainbot.com/

Bjoern

unread,
Apr 5, 2009, 1:40:32 PM4/5/09
to mwlib
Hi Volker,

I just wanted to check whether the new trunk version has gone live.
(The page still renders as before.)

All the best,
Bjoern

Volker Haas

unread,
Apr 6, 2009, 9:38:05 AM4/6/09
to mw...@googlegroups.com
Hi Bjoern,
sorry for the delay. The reason was the reimplementation of some core
parts of the parser. Testing took a little longer than we thought, and
therefore we didn't release a new package. But this time I am very sure
that we'll upload a package very soon - possibly today.

Best,
volke...@brainbot.com http://www.brainbot.com/

Bjoern

unread,
Apr 18, 2009, 1:07:49 PM4/18/09
to mwlib
Hi Volker,

many thanks - italics within blockquote now works!

Background colours only seem to work for single paragraph divs, but
that's ok with me.

All the best,
Bjoern
> volker.h...@brainbot.com    http://www.brainbot.com/
Reply all
Reply to author
Forward
0 new messages