Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I force MediaWiki to respect single line breaks?

Tags:

php

mediawiki

By default, MediaWiki ignores single line breaks, treating them as a single space. To insert a new line in a page, you must insert two consecutive line breaks in the source, which results in a new paragraph: </p><p>. It's also possible to insert <br /> directly into the source.

How can I modify the MediaWiki parsing engine so single line breaks in the source are replaced automatically with a <br /> in the resulting HTML?

(Source: http://www.mediawiki.org/wiki/Help:Formatting)

like image 643
meetar Avatar asked Apr 29 '12 20:04

meetar


People also ask

How do you skip a line in Wikipedia?

The <br /> or <br> tags are used for a single forced line break.

How do you set a line break?

Press ALT+ENTER to insert the line break.

How do you make a new line in Wikipedia?

To insert a new line in a page, you must insert two consecutive line breaks in the source, which results in a new paragraph: </p><p> . It's also possible to insert <br /> directly into the source.

How do I break a line in stackoverflow?

Add two spaces at the end, to have a soft line break, that will just add a newline to the rendered text. Add a break and an extra empty line to start a new paragraph.


2 Answers

Use https://www.mediawiki.org/wiki/Extension:Poem

<poem>
Roses are red
Violets are blue
</poem>
like image 68
MaxSem Avatar answered Sep 21 '22 17:09

MaxSem


<pre></pre>

This html tag seems to do the job for me.

like image 34
Ryan Avatar answered Sep 22 '22 17:09

Ryan