tag:help.tenderapp.com,2008-11-12:/discussions/problems/707-new-line-fix-pleaseTender: Discussion 2011-04-07T06:08:32Ztag:help.tenderapp.com,2008-11-12:Comment/2284582009-07-02T13:46:43Z2009-07-02T13:48:25Znew line fix PLEASE<div><p>I ran across this actually on a rails project I was working
on... the simple_format helper doesn't use line breaks properly
from text boxes and garbles the hell out of pasted text (for
example from a command prompt)... the solution, instead of using
simple_format (or whatever helper your using) is to use a regex to
replace the line breaks... Its really annoying to have to go back,
edit a post, and do this</p>
<p>line 1</p>
<p>line 2</p>
<p>line 3</p>
<p>just so it will format properly; 1 line break = 1 br tag.... 2
\n's != 1 br (you'll have to hit edit to see what im talking about
admins, it does it on tender AND lighthouse, lighthouse is the one
i'd prefer first fixed)</p>
<p>Thanks, Josh</p></div>joshtag:help.tenderapp.com,2008-11-12:Comment/2284582009-07-02T13:57:58Z2009-07-02T13:58:30Znew line fix PLEASE<div><p>REGEX:</p>
<pre>
<code> STRING.gsub(/\n/, '<br>')</code>
</pre></div>joshtag:help.tenderapp.com,2008-11-12:Comment/2284582009-07-02T14:21:51Z2009-07-02T14:21:51Znew line fix PLEASE<div><p><code>simple_format</code> uses regex actually. We use a
modified version of it if you turn plain text formatting on. By
default, <a href=
"http://daringfireball.net/projects/markdown/">markdown</a> is used
though. You can either put two spaces after lines, or wrap whole
paragraphs with the <code>@@@</code></p>
<pre>
<code> @@@
foo
bar
@@@</code>
</pre></div>ricktag:help.tenderapp.com,2008-11-12:Comment/2284582009-07-02T14:29:08Z2009-07-02T14:29:08Znew line fix PLEASE<div><p>Yes but you can't do that on Lighthouse :)</p>
<pre>
<code>I dont want to have to
type every ticket
with AT signs around it</code>
</pre></div>joshtag:help.tenderapp.com,2008-11-12:Comment/2284582009-07-02T14:59:44Z2009-07-02T14:59:44Znew line fix PLEASE<div><p>Oh we're talking about Lighthouse? Lighthouse has no plain text
format, sorry.</p></div>ricktag:help.tenderapp.com,2008-11-12:Comment/2284582009-07-02T15:09:20Z2009-07-02T15:09:20Znew line fix PLEASE<div><p>Yes I know it doesnt. Thats the point of this ticket :). It
doesn't format line breaks properly.</p></div>joshtag:help.tenderapp.com,2008-11-12:Comment/2284582009-07-02T16:07:00Z2009-07-02T16:07:00Znew line fix PLEASE<div><p>Sure, but this ticket is in the Tender section, right? I get
confused, sometimes I give people Tender answers to Lighthouse
questions.</p>
<p>It's going to require a nasty migration to a table, but I'll be
adding the option for users to choose plain or markdown formatting
for their posts. Emails come in plain text by default as well.</p></div>rick