Last modified: 2014-11-18 18:07:09 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 T11207, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 9207 - Single newlines sometimes create paragraphs
Single newlines sometimes create paragraphs
Status: NEW
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
unspecified
All All
: Low minor with 4 votes (vote)
: ---
Assigned To: C. Scott Ananian
http://hu.wikipedia.org/wiki/User:Tgr/p
: newparser
: 53043 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-03-07 11:55 UTC by Tisza Gergő
Modified: 2014-11-18 18:07 UTC (History)
8 users (show)

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


Attachments

Description Tisza Gergő 2007-03-07 11:55:42 UTC
Tutorials like [[mw:Help:Formatting]] state that a single new-line will have no
effect, however, that is not always the case. Single new-lines after block-level
HTML elements might result in unnecessary <p> tags being created: while
<div>foo</div> results in just that, <div>\nfoo\n</div> will result in
<div><p>foo</p></div>. This can be very confusing because some CSS attributes of
the div tag will have no effect (they will be overwritten by <p> rules in some
CSS file). See the link for an example.
Comment 1 Tisza Gergő 2007-03-07 22:34:37 UTC
It is worse than it seemed: two line breaks *anywhere in the text* will cause a
<p> and a </p> to appear at the line breaks.

The following will appear unchanged in the rendered page:

<div>A B C</div>

This, however:

<div>A
B
C</div>

will appear in the output as

<div>A
<p>B</p>
C</div>

See [[hu:User:Tgr/p]] for a test case.
Comment 2 Florian 2007-07-03 12:12:24 UTC
However, it seems like

 <div>
 A
 B
 C
 </div>

will result in

 <div>A B C</div>

It's an important bug, I wonder why there is as little activity.
Comment 3 Aryeh Gregor (not reading bugmail, please e-mail directly) 2007-07-03 21:03:58 UTC
Because 1) it's not important, it's not just rare but often unnoticeable when it occurs, and 2) mucking with our atrocity of a parser is not something anyone wants to do.
Comment 4 Florian 2007-07-03 21:43:57 UTC
1) It was important for me ;-) For the anecdote, I used to make a very simple template, who takes one or more paragraphs, and displays them with a <span> at the beginning, surrounded by a <div> :
	<div><span>foobar</span> - {{{1}}}</div>
which, with the first parameter
	A \n B \n C
results in
	<div><span>foobar</span> - A
	<p>B
	</p>
	C</div>
which isn't unnoticeable at all. If I hadn't asked for help in Wikipedia-fr, I'd never know that leaving a newline after the <div> and before the </div> will fix this. In fact, it's above all surprising.
2) That's an argument, which I can easily understand ;-)
Comment 5 Mormegil 2008-12-10 14:04:51 UTC
Note: This is partially (?) a duplicate of bug #5718
Comment 6 Mark A. Hershberger 2011-04-12 16:13:28 UTC
Punting this to the new parser Brion has under development.
Comment 7 Bartosz Dziewoński 2013-08-19 15:49:43 UTC
*** Bug 53043 has been marked as a duplicate of this bug. ***

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


Navigation
Links