Loading ...
Sorry, an error occurred while loading the content.
 

Editor troubles

Expand Messages
  • marcohamersma
    Hello all, For a project I needed to use a rich text editor. I had some bad experience with tinymce, so I turned to the YUI editor. There are some minor and
    Message 1 of 5 , Aug 24, 2008
      Hello all,
      For a project I needed to use a rich text editor. I had some bad experience with tinymce, so I turned to the YUI editor. There are some minor and major problems I've been having and I can't seem to get around them, I would be grateful if someone can help me with this.

      I am using the editor for a small cms written in php, and the end users will not have a lot of experience with computers.

      One of the first problems I encountered was the fact that the editor doesn't seem to do create xhtml code even though I configured it to use it, I solved this program using some server side code when the text is processed.

      The second is paragraphs, the design in which the content will be put relies on the fact that the text uses [p] tags, the editor insists on using only [br] tags. again, I solved this using some server side code, but i'd rather not

      And now the biggest problem, the YUI editor seems to insert extra line breaks, even in lists. I put a picture  up illustrating the problem. When I fill another textarea with the same content on the same page, it shows correct code, so there is nothing wrong with the incoming text, just with the way yui parses it. I also tried removing all line breaks from the source file but it doesn't help.

      Does this sound familiar to anyone, is there something I can do about all this? The priority is with the last problem because that confronts the end user, but maybe there is something wrong with my configuration that is causing the problem.

      the beginning of my configuration:
      var myEditor = new YAHOO.widget.Editor('msgpost', {
          height: '350px',
          width: '575px',
          dompath: true,
          handleSubmit: true,
          focusAtStart: true,
          plainText: true,
          markup: "xhtml",
          autoHeight:true,

      After this there is the toolbar configuration and the activation.
    • Dav Glass
      marcohamersma -- 1. Please explain the first issue a little more doesn t seem to do create xhtml doesn t help if I don t know what it s doing/not doing. 2.
      Message 2 of 5 , Aug 24, 2008
        marcohamersma --

        1. Please explain the first issue a little more "doesn't seem to do create xhtml" doesn't help if I don't know what it's doing/not doing.

        2. The RTE was not designed to support paragraph tags. There are a few people using it in production that have implemented this feature and are wanting to give the code back to us so we can roll it back into YUI. As far as I know, no one has released their code yet.

        3. I think your issue here is that you have the "plainText" config option set. That config option replaces all "\n" characters in the textarea with a <br>. So if you have a list in there, it will add <br> after every </li> since it probably has a "\n" after it.

        Does that make sense?
        Dav

         
        Dav Glass
        dav.glass@...
        blog.davglass.com



        + Windows: n. - The most successful computer virus, ever. +
        + A computer without a Microsoft operating system is like a dog
        without bricks tied to its head +
        + A Microsoft Certified Systems Engineer is to computing what a
        McDonalds Certified Food Specialist is to fine cuisine +


        ----- Original Message ----
        From: marcohamersma <marco@...>
        To: ydn-javascript@yahoogroups.com
        Sent: Sunday, August 24, 2008 9:29:57 AM
        Subject: [ydn-javascript] Editor troubles

        Hello all,
        For a project I needed to use a rich text editor. I had some bad experience with tinymce, so I turned to the YUI editor. There are some minor and major problems I've been having and I can't seem to get around them, I would be grateful if someone can help me with this.

        I am using the editor for a small cms written in php, and the end users will not have a lot of experience with computers.

        One of the first problems I encountered was the fact that the editor doesn't seem to do create xhtml code even though I configured it to use it, I solved this program using some server side code when the text is processed.

        The second is paragraphs, the design in which the content will be put relies on the fact that the text uses [p] tags, the editor insists on using only [br] tags. again, I solved this using some server side code, but i'd rather not

        And now the biggest problem, the YUI editor seems to insert extra line breaks, even in lists. I put a picture  up illustrating the problem. When I fill another textarea with the same content on the same page, it shows correct code, so there is nothing wrong with the incoming text, just with the way yui parses it. I also tried removing all line breaks from the source file but it doesn't help.

        Does this sound familiar to anyone, is there something I can do about all this? The priority is with the last problem because that confronts the end user, but maybe there is something wrong with my configuration that is causing the problem.

        the beginning of my configuration:
        var myEditor = new YAHOO.widget.Editor('msgpost', {
            height: '350px',
            width: '575px',
            dompath: true,
            handleSubmit: true,
            focusAtStart: true,
            plainText: true,
            markup: "xhtml",
            autoHeight:true,

        After this there is the toolbar configuration and the activation.
      • marcohamersma
        Dear Dav, 1. I might have been a little quick on drawing my conclusion, but I based it on the fact that the line breaks yui creates are all instead of
        Message 3 of 5 , Aug 24, 2008
          Dear Dav,

          1. I might have been a little quick on drawing my conclusion, but I
          based it on the fact that the line breaks yui creates are all <br>
          instead of <br />. I thought setting the markup option in the
          configuration to "xhtml" would fix it, but that made no difference.

          2. Ok, I understand. Though I am curious why the editor wasn't
          designed to support the paragraph tag, is there a motivation for that
          choice?

          3. That indeed makes sense and it solved the problem. Thank you

          --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@...> wrote:
          >
          > marcohamersma --
          >
          > 1. Please explain the first issue a little more "doesn't seem to do
          create xhtml" doesn't help if I don't know what it's doing/not doing.
          >
          > 2. The RTE was not designed to support paragraph tags. There are a
          few people using it in production that have implemented this feature
          and are wanting to give the code back to us so we can roll it back
          into YUI. As far as I know, no one has released their code yet.
          >
          > 3. I think your issue here is that you have the "plainText" config
          option set. That config option replaces all "\n" characters in the
          textarea with a <br>. So if you have a list in there, it will add <br>
          after every </li> since it probably has a "\n" after it.
          >
          > Does that make sense?
          > Dav
          >
          >
          > Dav Glass
          > dav.glass@...
          > blog.davglass.com
          >
        • Dav Glass
          marcohamersma -- 1. It should convert them when you call saveHTML(). While it s inside Edit mode it will use the browsers default. When you save the data out,
          Message 4 of 5 , Aug 24, 2008
            marcohamersma --

            1. It should convert them when you call saveHTML(). While it's inside Edit mode it will use the browsers default. When you save the data out, does it not convert the <br>'s to <br />'s?

            2. The reasoning for it was simple. It took 5 lines of code to make IE act like the other A-Grade browsers. By default, the other browsers support <br>'s for Enter. IE is the only one that defaults to <p>. I could stop IE's behavior with very little code. In order to make the other A-Grade browsers use <p>'s instead would take 100-200~ lines of code.

            Does that make sense?
            Dav
             
            Dav Glass
            dav.glass@...
            blog.davglass.com



            + Windows: n. - The most successful computer virus, ever. +
            + A computer without a Microsoft operating system is like a dog
            without bricks tied to its head +
            + A Microsoft Certified Systems Engineer is to computing what a
            McDonalds Certified Food Specialist is to fine cuisine +


            ----- Original Message ----
            From: marcohamersma <marco@...>
            To: ydn-javascript@yahoogroups.com
            Sent: Sunday, August 24, 2008 10:42:34 AM
            Subject: [ydn-javascript] Re: Editor troubles

            Dear Dav,

            1. I might have been a little quick on drawing my conclusion, but I
            based it on the fact that the line breaks yui creates are all <br>
            instead of <br />. I thought setting the markup option in the
            configuration to "xhtml" would fix it, but that made no difference.

            2. Ok, I understand. Though I am curious why the editor wasn't
            designed to support the paragraph tag, is there a motivation for that
            choice?

            3. That indeed makes sense and it solved the problem. Thank you 

            --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@...> wrote:
            >
            > marcohamersma --
            >
            > 1. Please explain the first issue a little more "doesn't seem to do
            create xhtml" doesn't help if I don't know what it's doing/not doing.
            >
            > 2. The RTE was not designed to support paragraph tags. There are a
            few people using it in production that have implemented this feature
            and are wanting to give the code back to us so we can roll it back
            into YUI. As far as I know, no one has released their code yet.
            >
            > 3. I think your issue here is that you have the "plainText" config
            option set. That config option replaces all "\n" characters in the
            textarea with a <br>. So if you have a list in there, it will add <br>
            after every </li> since it probably has a "\n" after it.
            >
            > Does that make sense?
            > Dav
            >
            >
            >  Dav Glass
            > dav.glass@...
            > blog.davglass.com
            >


            ------------------------------------

            Yahoo! Groups Links

            <*> To visit your group on the web, go to:
                http://groups.yahoo.com/group/ydn-javascript/

            <*> Your email settings:
                Individual Email | Traditional

            <*> To change settings online go to:
                http://groups.yahoo.com/group/ydn-javascript/join
                (Yahoo! ID required)

            <*> To change settings via email:
                mailto:ydn-javascript-digest@yahoogroups.com
                mailto:ydn-javascript-fullfeatured@yahoogroups.com

            <*> To unsubscribe from this group, send an email to:
                ydn-javascript-unsubscribe@yahoogroups.com

            <*> Your use of Yahoo! Groups is subject to:
                http://docs.yahoo.com/info/terms/

          • marcohamersma
            Hello Dav, Thank you very much for your help, everything is working as it should Marco ... inside Edit mode it will use the browsers default. When you save the
            Message 5 of 5 , Aug 25, 2008
              Hello Dav,

              Thank you very much for your help, everything is working as it should

              Marco

              --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@...> wrote:
              >
              > marcohamersma --
              >
              > 1. It should convert them when you call saveHTML(). While it's
              inside Edit mode it will use the browsers default. When you save the
              data out, does it not convert the <br>'s to <br />'s?
              >
              > 2. The reasoning for it was simple. It took 5 lines of code to make
              IE act like the other A-Grade browsers. By default, the other browsers
              support <br>'s for Enter. IE is the only one that defaults to <p>. I
              could stop IE's behavior with very little code. In order to make the
              other A-Grade browsers use <p>'s instead would take 100-200~ lines of
              code.
              >
              > Does that make sense?
              > Dav
              >
              > Dav Glass
              > dav.glass@...
              > blog.davglass.com
              >
              >
              >
              >
              > + Windows: n. - The most successful computer virus, ever. +
              > + A computer without a Microsoft operating system is like a dog
              > without bricks tied to its head +
              > + A Microsoft Certified Systems Engineer is to computing what a
              > McDonalds Certified Food Specialist is to fine cuisine +
              >
              >
              >
              > ----- Original Message ----
              > From: marcohamersma <marco@...>
              > To: ydn-javascript@yahoogroups.com
              > Sent: Sunday, August 24, 2008 10:42:34 AM
              > Subject: [ydn-javascript] Re: Editor troubles
              >
              > Dear Dav,
              >
              > 1. I might have been a little quick on drawing my conclusion, but I
              > based it on the fact that the line breaks yui creates are all <br>
              > instead of <br />. I thought setting the markup option in the
              > configuration to "xhtml" would fix it, but that made no difference.
              >
              > 2. Ok, I understand. Though I am curious why the editor wasn't
              > designed to support the paragraph tag, is there a motivation for that
              > choice?
              >
              > 3. That indeed makes sense and it solved the problem. Thank you
              >
              > --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@> wrote:
              > >
              > > marcohamersma --
              > >
              > > 1. Please explain the first issue a little more "doesn't seem to do
              > create xhtml" doesn't help if I don't know what it's doing/not doing.
              > >
              > > 2. The RTE was not designed to support paragraph tags. There are a
              > few people using it in production that have implemented this feature
              > and are wanting to give the code back to us so we can roll it back
              > into YUI. As far as I know, no one has released their code yet.
              > >
              > > 3. I think your issue here is that you have the "plainText" config
              > option set. That config option replaces all "\n" characters in the
              > textarea with a <br>. So if you have a list in there, it will add <br>
              > after every </li> since it probably has a "\n" after it.
              > >
              > > Does that make sense?
              > > Dav
              > >
              > >
              > > Dav Glass
              > > dav.glass@
              > > blog.davglass.com
              > >
              >
              >
              > ------------------------------------
              >
              > Yahoo! Groups Links
              >
              >
              >
              > http://docs.yahoo.com/info/terms/
              >
            Your message has been successfully submitted and would be delivered to recipients shortly.