Skip to main content
WolfShade
Legend
May 11, 2018
Answered

Oracle 11g: Keeping user input format as entered, display on page

  • May 11, 2018
  • 1 reply
  • 260 views

Hello, all,

I have hit a brick wall, and could use some advice.

I am working on a customized blog that allows users to comment on threads.  HTML is not allowed, and is stripped out before the content is inserted into the database (Oracle 11g, TEXT datatype).  But if a user hits the enter key within the textarea, that line break is retained in Oracle.  However, displaying the input after pulling it from the database loses line breaks.

What is the best way to keep the formatting as the user entered it (including bullet points) for display in an HTML page?  I tried the <pre> tags around the output, but that strips font CSS from the display, and puts a horizontal scrollbar at the bottom of the containing div.

I tried putting <p> tags in place of line breaks, but then when the comment is edited, the HTML shows in the form textarea.  (That's not good, either.)

What are some options?

V/r,

^ _ ^

    This topic has been closed for replies.
    Correct answer WolfShade

    Never mind.  I discovered it.  I'm banging my head on the desk.  white-space: pre-wrap.

    I hate that I do not know much about CSS, but I guess I'm learning the hard way. 

    Have a great weekend, all.

    V/r,

    ^ _ ^

    1 reply

    WolfShade
    WolfShadeAuthorCorrect answer
    Legend
    May 11, 2018

    Never mind.  I discovered it.  I'm banging my head on the desk.  white-space: pre-wrap.

    I hate that I do not know much about CSS, but I guess I'm learning the hard way. 

    Have a great weekend, all.

    V/r,

    ^ _ ^