Jump to content

My own text editor for blog


gordon.c

Recommended Posts

Hi,

 

I am bulding an editor for my blog and am having troubles especially with "\n" characters.

I transform every "\n" to "<br />" so that any spaces are translated into HTML code but a huge problem occurs in code like this.

 

This is my semi code created by the editor when requested to create a table

 

[table]
[row]
	[col] [/col]
	[col] [/col]
	[col] [/col]
[/row]
[row]
	[col] [/col]
	[col] [/col]
	[col] [/col]
[/row]
[/table]

 

As you can see there are many "\n" characters which drag the table several lines down from where it should be since there is transformation of every single "\n" character. Any idea how to deal with this? Thank you for help

 

Link to comment
https://forums.phpfreaks.com/topic/164145-my-own-text-editor-for-blog/
Share on other sites

I doubt it is that people don't understand, it's just that most of us have thought the same way you do... that is until we realize that all of this time could be spent improving your site instead of writing code someone else has already figured out... that they offer up for free even.

 

Aside from that, I'm not sure I understand the question. What would you expect the output to look like?

The problem is that the example with the table consists of several "\n" chars therefor when translated into HTML code the table is moved several lines down because of translating each "\n" into "<br />".

 

This translation is vital for the editor when separating paragraphs but is troublesome when creating a table.

 

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.