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
https://forums.phpfreaks.com/topic/116360-problem-with-formatting/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.