Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9298111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T22:14:30+00:00 2026-06-18T22:14:30+00:00

I’m currently developing this in Python (with web.py) on Windows, and using latest Chrome.

  • 0

I’m currently developing this in Python (with web.py) on Windows, and using latest Chrome.

Simple test:

  1. User is shown a basic web form with a component.
  2. When form is submitted, the content of this textarea is placed into a MySql table, unmodified.
  3. Later, the user returns to edit their last submission.
  4. I then present a new form, with the textarea populated directly from the database for modification – HTML is prevented from being processed so tags are displayed.
  5. However, when re-displayed to the user, every line now has an extra (unwanted) line-break between each line.

How can I prevent this?

eg:

Submitted Text:

Line 1
Line 2

When re-displayed, the text looks like:

Line 1

Line 2

I’m aware that this is going to be some kind of CR LF issue but can’t quite get to the solution.
I tried a conversion to <br /> but that just displays the <br /> text not an actual line break.
I don’t really want to modify the text before putting it into the database either.
But I guess I do need something that would compensate for various OS that display line breaks differently.

I’ve read through many of the similar questions here, but they are primarily PHP, or talk about nl2br which wouldn’t be a solution here anyway.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T22:14:31+00:00Added an answer on June 18, 2026 at 10:14 pm

    If you are using print to output the text, append a comma at the end of your statement to remove the new-line character.

    e.g.

    print 'Some Text',
    

    It may be that a new-line is already in your printed text and doesn’t require the extra appended one from print.

    If not, try .rstrip('\n') on your string to remove any new-lines.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm making a simple page using Google Maps API 3. My first. One marker
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am using JSon response to parse title,date content and thumbnail images and place
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.