Jump to content

Problem with formatting


geoldr

Recommended Posts

Hello all, so I have a question. I have programmed a application which let's registered users on my website store create text documents online.

Everything is finished and works great. When you make a new document it displays its title and its linked to the page where if you click you  can read the actual document. Just like a forum post.

Anyways, here's the problem.

I am using < pre > tags to save my formatting. Some users like to put spaces, and I myself like to make multiple paragraph breaks.

Well, with the < pre > tag, if a user posts one long sentence, the sentence comes off my page!!

If I don't use the < pre > tag, then everything looks good, but there is no formatting.

Of course, I know I can replace the ' ' with an "nbsp" and a line break with a < br > tag, but heres why I don't want to do that. If a user wants to edit a page, it takes them back to the same dialog and inputs their information into the text fields. If my program were to replace everything, their document would have all sorts of HTML code in it! And I don't want that.

So my question is, how do I get passed this? This is very important, and I can't seem to find a solution.

How do all forum pages do it? And if you go to the forum post edit page, there is no HTML code, so theres obviously a way to do it, but how?!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.