YUILibrary - Open source JavaScript and CSS for building richly interactive software.
Fork YUI on GitHub
  [ 5 posts ]

john martirano

  • Username: johnmartirano
  • Joined: Wed Jul 28, 2010 10:59 am
  • Posts: 5
  • IRC: martirano
  • Offline
  • Profile
Tags:

Yui Editor ptags: true mis-behaves

Post Posted: Wed Jul 28, 2010 11:55 am
+0-
I've been trying to use
ptags: true
in my yui editor config and it generates some strange behavior.
It wraps the current line in <p></p> tags which is reasonable if you press return at the *end* of a line.
However if you press it at the beginning or even at the middle of a line,
it merely adds <p>&nbsp;</p> after the text of the current line.

So for example if i place a cursor in a fresh editor window and alert out my html i get:
html=<br>

If i then type 'hello world' without pressing return i get:
html=hello world<br>

If i then press return it reformats visually and in terms of tags i get:
html=<p>hello world</p><p>&nbsp;</p>

This is still reasonable behavior as I pressed return at the end of the line,
However if i back up my cursor and press return after 'hello' (ie in the middle of the line) i get:
html=<p>hello world</p><p>&nbsp;</p><p>&nbsp;</p>

So it ignores my cursor placement and always assumes im at the end of the line,
this also means that if i attempt to back up to the beginning of the document and press
return i get:
html=<p>hello world</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>

So I can never place any content in its own paragraph or line before the existing content
on the first line. Nor can I break up an existing paragraph into two paragraphs.

Any thoughts? is this a known bug? Or can this be the way it's intended it to work?
We've tried this both in our own code and in an example i made when testing the spellchecker found here:
http://john.martirano.net/code/spelltest/test2/
you can reproduce the problem here, commenting out ptags: true fixes the problem.
John

john martirano

  • Username: johnmartirano
  • Joined: Wed Jul 28, 2010 10:59 am
  • Posts: 5
  • IRC: martirano
  • Offline
  • Profile

Re: Yui Editor ptags: true mis-behaves

Post Posted: Thu Jul 29, 2010 5:17 pm
+0-
I should add - the reason we want to use ptags is that we have a custom version of the editor which only embeds structural and semantic content, no styling. This is why paragraphs are desirable over br line-breaks which are often mis-used in attempts to create paragraphs, the result being that you cant tell where paragraphs begin or end. With using only ptags this problem is solved. So it is an important feature!

If there is no plan to solve this bug it would still be useful even if a veteran could give guidance on how we could go about overriding the 'return' event to achieve what we need.

john martirano

  • Username: johnmartirano
  • Joined: Wed Jul 28, 2010 10:59 am
  • Posts: 5
  • IRC: martirano
  • Offline
  • Profile
Tags:

Re: Yui Editor ptags: true mis-behaves

Post Posted: Tue Aug 03, 2010 6:19 am
+0-
bump....

john martirano

  • Username: johnmartirano
  • Joined: Wed Jul 28, 2010 10:59 am
  • Posts: 5
  • IRC: martirano
  • Offline
  • Profile
Tags:

Re: Yui Editor ptags: true mis-behaves

Post Posted: Tue Aug 10, 2010 11:59 am
+0-
bump - still unsolved.

john martirano

  • Username: johnmartirano
  • Joined: Wed Jul 28, 2010 10:59 am
  • Posts: 5
  • IRC: martirano
  • Offline
  • Profile

Re: Yui Editor ptags: true mis-behaves

Post Posted: Wed Aug 18, 2010 6:07 pm
+0-
bump... still unresolved... anybody have any guidance??
is editor 3.0 slated to solve this issue?
  [ 5 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
cron