David Recordon (daveman692) wrote in lj_dev,
David Recordon

Enhancing the RTE

So I've been spending part of the day working on integrating FCKeditor into LJ, since we all know the current rich text editor isn't great. Issue I'm running into is it always converts <, >, and & to their html entities on submit. So this presents a problem for people wanting to type something like <lj user='test' />.

So two solutions I see:
A) Stop the entity conversion
B) Write a plugin that adds toolbar buttons for LJ specific tags

Issue with A is that I can't figure out where the this conversion is happening. I have disabled the FCKConfig.ProcessHTMLEntities option, but a comment in fckhtmlentities.js says, "This entity is automatically handled by the XHTML parser". Every place it seems like it would be doing this conversion, it isn't. So frustrated with this option.

Issue with B is I that can write a plugin to add a toolbar button with no problem, but don't think I can make it convert an lj tag when someone goes from normal to rich mode. Also not sure how to visually represent things like an lj-cut in the editing interface.

Another option is to always convert the entity back on form submission, client or server side, this however would mean that I couldn't type the entities in the RTE like I did above as an example tag.

So two solutions, neither of which seem perfect. Seems like the good solution is a combination of A and B, so a button to add these tags, and have them show up as a tag in the rich view while not being converted to entities on submit. Been reading through the project's site on SourceForge and seems like others have this same issue with entities; though I guess the project hasn't decided to address it yet. Costs $175 in a donation to get "email support". Anyone familiar with FCKeditor?

Edit: Seems like I've just been going crazy with this all day and it is a fairly easy solution. On submit we do a bit of a onversion which should end up with the right stuff in the end. Sorry for the friends page spam. :P
  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded