gordon.c Posted June 29, 2009 Share Posted June 29, 2009 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 More sharing options...
aggrav8d Posted June 29, 2009 Share Posted June 29, 2009 Sorry for playing devil's advocate, but is reinventing the wheel really necessary? How does TinyMCE not meet your needs already? Link to comment https://forums.phpfreaks.com/topic/164145-my-own-text-editor-for-blog/#findComment-865881 Share on other sites More sharing options...
gordon.c Posted June 29, 2009 Author Share Posted June 29, 2009 You are right TinyMCE is absolutely perfect, but that is kind of against my whole point. I actually like to create code and understand it rather than just use some already made even thought one may not understand why. Link to comment https://forums.phpfreaks.com/topic/164145-my-own-text-editor-for-blog/#findComment-865890 Share on other sites More sharing options...
MatthewJ Posted June 29, 2009 Share Posted June 29, 2009 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? Link to comment https://forums.phpfreaks.com/topic/164145-my-own-text-editor-for-blog/#findComment-865925 Share on other sites More sharing options...
gordon.c Posted June 30, 2009 Author Share Posted June 30, 2009 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. Link to comment https://forums.phpfreaks.com/topic/164145-my-own-text-editor-for-blog/#findComment-866211 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.