Change rendering of basic text to use <p></p> instead of <br />

Oct 5, 2011 at 1:01 PM

WikiPlex renders basic text without adding paragraph <p> tags, instead inserting <br /> where there is a new line.

Unfortunately, this prevents me from being able to target the resultant HTML using CSS.

Is there a way to have WikiPlex render paragraphs properly?

Oct 5, 2011 at 1:47 PM

I recommend creating a fork and changing the behavior in WikiEngine.

Oct 15, 2011 at 2:13 PM

I've just been having a look at the source code and it's not immediately apparent how to change the behaviour :)

Paragraphs are dealt with as an afterthought using a simple regex that replaces a \n with a <br /> in WikiEngine.ReplaceNewLines(). The problem is that a paragraph should be a first-class citizen. It's not something that can be dealt with by sprinkling in HTML breaks at the end of paragraphs. A paragraph is not a break.

The engine should treat paragraphs just like it does any other element such as a header or bold. I've not taken a lot of time to digest the source, but my cursory glance suggests that this might take a reworking of WikiPlex's architecture :-(

I hope I'm wrong and that you or someone else could give me a leg-up on how to start making the changes...