Last modified: 2013-11-01 20:57:07 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T58233, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 56233 - Newline added after expandTemplate
Newline added after expandTemplate
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
Templates (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-28 09:36 UTC by François
Modified: 2013-11-01 20:57 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description François 2013-10-28 09:36:54 UTC
It seems that a newline is added when transcluding a template that ends with <div> (at least). Passing it to mw.text.trim before returning works.
Comment 1 François 2013-10-28 09:38:09 UTC
please read </div> instead of &lt;div>
Comment 2 Andre Klapper 2013-10-28 15:50:37 UTC
Thanks for taking the time to report this!

Is there an example wikipage/revision where this problem can be seen?
Comment 3 Brad Jorsch 2013-10-28 16:12:54 UTC
Seems to work fine here in local testing: I created a template with contents "<div>foo</div>", and no extra newline was included in the output of mw.getCurrentFrame():expandTemplate{title="foo"}.

Please provide a test case that shows this problem.
Comment 4 François 2013-10-28 19:06:07 UTC
Sorry in fact it does the same with simple template transclusion; I have made some tests in https://fr.wikibooks.org/wiki/Utilisateur:François_Melchior/Bac_à_sable/Lua/t5
Comment 5 Brad Jorsch 2013-10-29 14:53:37 UTC
(In reply to comment #4)
> Sorry in fact it does the same with simple template transclusion; I have made
> some tests in
> https://fr.wikibooks.org/wiki/Utilisateur:François_Melchior/Bac_à_sable/Lua/
> t5

Your test cases aren't showing any extra newline, either. And even if it were happening, if it also happens with normal transclusion then it's not a bug in Scribunto.

Do note that "x<div>Hello</div>z" is going to render with the "Hello" on a new line, because <div> is a block element. And that HTML Tidy as used on WMF wikis will insert a newline after the </div> as part of its "tidying" of the HTML for the same reason.

I'm going to close this bug. If you can put together a test case that clearly shows something going wrong, feel free to reopen.
Comment 6 François 2013-11-01 20:57:07 UTC
Ok

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links