[Mediawiki-l] Recognizing individual line breaks as <br />

Brion Vibber brion at pobox.com
Thu Oct 28 20:28:12 UTC 2004


On Oct 28, 2004, at 9:55 AM, Jack Lutz wrote:
> I'm trying to modify MediaWiki so that a single linebreak in the edit 
> box will
> be written as <br />. Has this been decided against for some reason? 
> If it's
> possible to do easily, I'd appreciate any help. Thanks.

The first reason is compatibility: many older articles on Wikipedia had 
literal line breaks inserted in the source text, whether manually or by 
the older software I don't know. These are not supposed to be line 
breaks in output.

The second reason is... compatibility. When the allowed HTML subset is 
used, line breaks are common to make the markup clear, and you _really_ 
don't want to be adding in <br />s everywhere.

The third reason... compatibility. Line breaks at the edge of 
block-level constructions (paragraphs, list lines) and table rows and 
other such constructs also should not have <br />s added to them. Line 
break already has a specific block-level meaning in many such 
constructs (dividing list lines, table rows, etc).

So if you want \n to turn to <br /> to appear only where you want it, 
you'll need to be careful.

-- brion vibber (brion @ pobox.com)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://lists.wikimedia.org/pipermail/mediawiki-l/attachments/20041028/c0a39790/attachment.pgp 


More information about the MediaWiki-l mailing list