You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by Cristina Constantinescu <cr...@crispico.com> on 2014/03/13 16:46:22 UTC

CSS style in RichText issue

Hi,

I have the following code:

public var str1:String = "<html><p>This is a loooooooooooooong 
message.</p><p style='text-align: center'>Short message</p>";
public var str2:String = "<html><p>This is a loooooooooooooong 
message.</p><p align='center'>Short message</p>";

<s:RichText textFlow="{TextConverter.importToFlow(str1, 
TextConverter.TEXT_FIELD_HTML_FORMAT)}" />
<s:RichText textFlow="{TextConverter.importToFlow(str2, 
TextConverter.TEXT_FIELD_HTML_FORMAT)}" />

The second RichText sets paragraph style correctly, the first one doesn't.
Is there a way to make this work?

Thanks,
Cristina

Re: CSS style in RichText issue

Posted by Cristina Constantinescu <cr...@crispico.com>.
Ok. Thanks for your time.

On 14.03.2014 16:40, Alex Harui wrote:
> I did not see any flags/options that will change it.  You can try writing
> your own HTMLImporter by taking the one we have and upgrading it to do
> what you want.  But it might be easier just to replace strings before
> importing.
>
> -Alex
>
> On 3/14/14 12:16 AM, "Cristina Constantinescu"
> <cr...@crispico.com> wrote:
>
>> The displayed text comes from an user file and I want to import it
>> directly into RichText.
>> So there isn't an option to use or a way to support this, right?
>>
>> Have a nice day,
>> Cristina
>>
>> On 13.03.2014 18:23, Alex Harui wrote:
>>> I don't see any flags you can change to affect that.  Can you just
>>> replace
>>> text-align with align before importing?
>>>
>>> On 3/13/14 8:46 AM, "Cristina Constantinescu"
>>> <cr...@crispico.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> I have the following code:
>>>>
>>>> public var str1:String = "<html><p>This is a loooooooooooooong
>>>> message.</p><p style='text-align: center'>Short message</p>";
>>>> public var str2:String = "<html><p>This is a loooooooooooooong
>>>> message.</p><p align='center'>Short message</p>";
>>>>
>>>> <s:RichText textFlow="{TextConverter.importToFlow(str1,
>>>> TextConverter.TEXT_FIELD_HTML_FORMAT)}" />
>>>> <s:RichText textFlow="{TextConverter.importToFlow(str2,
>>>> TextConverter.TEXT_FIELD_HTML_FORMAT)}" />
>>>>
>>>> The second RichText sets paragraph style correctly, the first one
>>>> doesn't.
>>>> Is there a way to make this work?
>>>>
>>>> Thanks,
>>>> Cristina
>
>


Re: CSS style in RichText issue

Posted by Alex Harui <ah...@adobe.com>.
I did not see any flags/options that will change it.  You can try writing
your own HTMLImporter by taking the one we have and upgrading it to do
what you want.  But it might be easier just to replace strings before
importing.

-Alex

On 3/14/14 12:16 AM, "Cristina Constantinescu"
<cr...@crispico.com> wrote:

>The displayed text comes from an user file and I want to import it
>directly into RichText.
>So there isn't an option to use or a way to support this, right?
>
>Have a nice day,
>Cristina
>
>On 13.03.2014 18:23, Alex Harui wrote:
>> I don't see any flags you can change to affect that.  Can you just
>>replace
>> text-align with align before importing?
>>
>> On 3/13/14 8:46 AM, "Cristina Constantinescu"
>> <cr...@crispico.com> wrote:
>>
>>> Hi,
>>>
>>> I have the following code:
>>>
>>> public var str1:String = "<html><p>This is a loooooooooooooong
>>> message.</p><p style='text-align: center'>Short message</p>";
>>> public var str2:String = "<html><p>This is a loooooooooooooong
>>> message.</p><p align='center'>Short message</p>";
>>>
>>> <s:RichText textFlow="{TextConverter.importToFlow(str1,
>>> TextConverter.TEXT_FIELD_HTML_FORMAT)}" />
>>> <s:RichText textFlow="{TextConverter.importToFlow(str2,
>>> TextConverter.TEXT_FIELD_HTML_FORMAT)}" />
>>>
>>> The second RichText sets paragraph style correctly, the first one
>>>doesn't.
>>> Is there a way to make this work?
>>>
>>> Thanks,
>>> Cristina
>>
>


Re: CSS style in RichText issue

Posted by Cristina Constantinescu <cr...@crispico.com>.
The displayed text comes from an user file and I want to import it 
directly into RichText.
So there isn't an option to use or a way to support this, right?

Have a nice day,
Cristina

On 13.03.2014 18:23, Alex Harui wrote:
> I don't see any flags you can change to affect that.  Can you just replace
> text-align with align before importing?
>
> On 3/13/14 8:46 AM, "Cristina Constantinescu"
> <cr...@crispico.com> wrote:
>
>> Hi,
>>
>> I have the following code:
>>
>> public var str1:String = "<html><p>This is a loooooooooooooong
>> message.</p><p style='text-align: center'>Short message</p>";
>> public var str2:String = "<html><p>This is a loooooooooooooong
>> message.</p><p align='center'>Short message</p>";
>>
>> <s:RichText textFlow="{TextConverter.importToFlow(str1,
>> TextConverter.TEXT_FIELD_HTML_FORMAT)}" />
>> <s:RichText textFlow="{TextConverter.importToFlow(str2,
>> TextConverter.TEXT_FIELD_HTML_FORMAT)}" />
>>
>> The second RichText sets paragraph style correctly, the first one doesn't.
>> Is there a way to make this work?
>>
>> Thanks,
>> Cristina
>


Re: CSS style in RichText issue

Posted by Alex Harui <ah...@adobe.com>.
I don't see any flags you can change to affect that.  Can you just replace
text-align with align before importing?

On 3/13/14 8:46 AM, "Cristina Constantinescu"
<cr...@crispico.com> wrote:

>Hi,
>
>I have the following code:
>
>public var str1:String = "<html><p>This is a loooooooooooooong
>message.</p><p style='text-align: center'>Short message</p>";
>public var str2:String = "<html><p>This is a loooooooooooooong
>message.</p><p align='center'>Short message</p>";
>
><s:RichText textFlow="{TextConverter.importToFlow(str1,
>TextConverter.TEXT_FIELD_HTML_FORMAT)}" />
><s:RichText textFlow="{TextConverter.importToFlow(str2,
>TextConverter.TEXT_FIELD_HTML_FORMAT)}" />
>
>The second RichText sets paragraph style correctly, the first one doesn't.
>Is there a way to make this work?
>
>Thanks,
>Cristina