1 Reply Latest reply on Mar 9, 2012 2:31 AM by asdoghqa

    Trouble with applylink method on editmanager

    asdoghqa

      Hi there,

       

      Currently I'm working on a text editor that makes use of the editmanager class from the flashx.textLayout.edit  package  to make up and transform text. When I try to transform  a piece of text (textflow) into a link through the 'applylink' method on the editmanager class, the selected text on which I applied the link gets concatenated with the previous and following words. So the leading and trailing spaces are being removed from the text that gets transformed  into a link.

       

      The textflow before editing, for example, the text 'previous link following' look like this:

       

      <TextFlow whiteSpaceCollapse="collapse" version="2.0.0" xmlns="http://ns.adobe.com/textLayout/2008">

        <p>

          <span color="#000000">previous link following</span>

        </p>

      </TextFlow>

       

      After applying the link to the word 'link' the textflow looks like this:

       

      <TextFlow whiteSpaceCollapse="collapse" version="2.0.0" xmlns="http://ns.adobe.com/textLayout/2008">

        <p>

          <span></span>

          <span color="#000000">previous</span>

          <a href="http://www.google.com" target="_blank">

            <span>link</span>

          </a>

          <span color="#000000">following</span>

          <span></span>

        </p>

      </TextFlow>

       

      And the text 'previous link following' is presented like 'previouslinkfollowing'.

       

      I've used a TextArea and a RichEditableText component along with TextFlowUtil.importFromXML and TextConverter.importToFlow(text,TextConverter.TEXT_FIELD_HTML_FORMAT) and some other combination as well, but nothing seems to solve the problem.

       

      Does anyone know how to prevent this problem?

       

      Thanks and kind regards,

       

      A.S. Doghqa

       

      Message was edited by: asdoghqa