line-breaks

Is it "bad practice" to be sensitive to linebreaks in XML documents?

I'm generating some XML documents and when it comes to the address part I have fragments that look like this: <Address>15 Sample St Example Bay Some Country</Address> The XSLT that I have for converting this to XHTML has some funky recursive template to convert newline characters within strings to <br/> tags. This is all working fine...

Non-breaking non-space in HTML

I have a bowling web application that allows pretty detailed frame-by-frame information entry. One thing it allows is tracking which pins were knocked down on each ball. To display this information, I make it look like a rack of pins: o o o o o o o o o o Images are used to represent the pins. So, for the back row, I have 4 img...

How do I format a String in an email so Outlook will print the line breaks?

I'm trying to send an email in Java but when I read the body of the email in Outlook, it's gotten rid of all my linebreaks. I'm putting \n at the ends of the lines but is there something special I need to do other than that? The receivers are always going to be using Outlook. I found a page on microsoft.com that says there's a 'Remove ...

PHP Echo Line Breaks

I'm pretty sure this has already been answered, but for the life of me I could not find the question or answer after browsing/searching StackOverflow for the last 20 minutes. Anyway, the question: What's the difference between \n and \r (I know it has something to do with OS), and what's the best way to echo a line break that will work...

Alternatives to illegal <br> or <p> within <li> tags> on a hover?

Hi folks, does anyone have a suggestion for creating paragraph-type line spaces within a <li> tag that includes a hovered pop-up pseudo-class? I have a <span> that pops up on a:hover and I want the text that pops up to be broken into 2 paragraphs. It works with <br> in FF but I want to do the right thing (now that I've discovered it's ...

Possible to add line breaks in a textarea field while keeping it XHTML 1.0 valid?

EDIT: After re-reading my post I think I am being a little bit unclear about what the problem is. Let me try to re-phrase it: Users can leave comments on my site using a textarea field in a form. It should be possible to add line breaks in the comment using <br />. The comment is then stored as a string in a mysql-database (escaped to m...

Removing redundant line breaks with regular expressions

Hello, I'm developing a single serving site in PHP that simply displays messages that are posted by visitors (ideally surrounding the topic of the website). Anyone can post up to three messages an hour. Since the website will only be one page, I'd like to control the vertical length of each message. However, I do want to at least par...

What does Linq replace a new line with when updating?

I have always used Replace(myString, vbCrLf, "<br/>") to show line breaks when outting something to a page from the database (retaining line breaks). I am now using a DetailsView that has a textarea as one of the fields and uses a LinqDataSource as its datasource. I want to allow users to type line breaks in the textarea and display th...

Having line breaks between <li>s

I have a horizontal menu consisting of <li> elements with display: inline. The elements are supposed to be next to each other seamlessly. In the source code, I would like to have each li on one line for easier debugging: <li class="item1 first"> ... </li> <li class="item2"> ... </li> ... However, if I add a \n after each element, th...

Avoid line breaks when using out-file

Hi everyone, I'm getting a little frustrated on a little PowerShell script I'm writing. Basically I loop through text files to check every line against an array of regular expression patterns. The result gets piped to the out-file cmdlet which appends it to another text file. Get-ChildItem $logdir -Recurse -Include @('*.txt') | Get-Co...

Code line wrapping - how to handle long lines

I'm facing a particular line that is 153 characters long. Now, I tend to break things after 120 characters (of course, this is heavily dependent on where I am and the local conventions.) But to be honest, everywhere I break the line just makes it look bad. So I'm looking for some ideas on what I should do for it. Here's the line: priva...