> From: "Rob Church" <robchur(a)gmail.com>
> Date: January 2, 2007 6:33:39 AM EST
> To: "MediaWiki announcements and site admin list" <mediawiki-
> l(a)wikimedia.org>
> Subject: Re: [Mediawiki-l] Template to list 10 most recent created
> pages
> Reply-To: MediaWiki announcements and site admin list <mediawiki-
> l(a)Wikimedia.org>
>
>
> On 02/01/07, Vernon Thommeret <synotic(a)gmail.com> wrote:
>> The extension works well enough for me, but I just have a minor quip:
>> addHTML() seems to be ignoring any newlines I put in. Is there a way
>> to get around this? I also can't figure out how to remove the
>
> I'm not quite sure what you mean. Where are you adding newlines? A
> newline character is totally meaningless within HTML, remember - we
> have paragraph markup, and line breaks for that.
I'm just trying to present my markup a certain way. For instance,
instead of "<ol><li>", I'd format my code as "<ol>\n\t<li>". Using
$wgOut->addHTML, this generally works (and I've tested it in other
extensions), but it seems to have a really curious behavior in the
Newestpages extension. If I write "$wgOut->addHTML("coca\cola")" in
the other extensions I've tried, I get the expected "coca" followed
by a newline, followed by "cola". However, with Newestpages I get:
"<p>coca</p>\ncola". It almost seems as if it is using addWikiText
instead of addHTML, but in my tests, addWikiText adds simply
"<p>cocacola</p>" given "coca\ncola".
All of this behavior is even stranger when I look at the only
definition for the addHTML function:
function addHTML( $text ) { $this->mBodytext .= $text; }
There seems to be nothing that would cause it to do anything but
append the text to the main text. Could the text be somehow filtered
before it gets sent? Again, I realize that this is a minor point, but
I like to keep clean, functional markup, and a lot of extraneous
"<p></p>"s and confusing markup display defeats that.
Thanks.