HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Lines Breaks
Is anyone else bothered by requiring a <br /> to get to a new line?
I shouldn't need to use HTML just to start a new line like this...
Having to have a space between my lines (like this ^) making it a new paragraph when it isn't, is annoying.
I shouldn't need to use HTML just to start a new line like this...
Having to have a space between my lines (like this ^) making it a new paragraph when it isn't, is annoying.
Tagged:
0
Comments
As it defaults to false i think you may need to set it to true.
What's I'm saying is, a single newline doesn't create a line break unless you force it using the <br /> tag, it just continues the previous line.
$config->set('Output', 'Newline', "<br />");
Might help, the only problem is that that line will currently break the script as i think the whole page gets rendered with html purifier. If it were just the posts being purified it should work fine.
http://htmlpurifier.org/phorum/
$FormPostValues['Body'] = nl2br($FormPostValues['Body']);
on line 281 of the class.commentmodel.php in vanilla.
As the function suggests it takes new lines and replaces them with break lines.
There is probably other places where it needs to be added. Or done in a better place.
$this->Comment->Body = preg_replace('/<br\\s*?\/??>/i', '', $this->Comment->Body);
on line 306 of the post.php controller in vanilla. So it is displayed normally in the edit box. Again both code samples just get the job done, there may be more cases that it is needed it. A nice function to do it, new location of code samples or something.
Yeah i was being a plonk, you don't need all that i blame it on it being late. All you need to do is have this line
<div class="Body"><?php echo nl2br(Format::To($Comment->Body, $Comment->Format)); ?></div>
on line 80 of helper_functions.php in discussion folder of views and line breaks will work normally as you would expect.
Because I've cloned 2 days ago, and it still does not get on a new line in my test forum (except if I put 2 line break).
" in the html.
Any idea?
Could we make sure that both "\n" and "\r\n" get replaced in the future? Makes the code portable...
Thanks.
Strange folks
It also makes things looks bad when creating a new paragraph because a new paragraph requires 2 line-breaks, which ends up looking like: Edit: Just did some testing and noticed line-breaks work as expected when HTML Purifier if disabled, so the fix should probably be within the plugin rather than using a dirty workaround in the Vanilla application.
testing
the
lines
breaks