HTMLtext and selectedChunk

Alex Tweedly alex at tweedly.net
Thu Nov 7 10:48:26 EST 2024


You would normally do something like

put the selectedchunk
    -----> char 5 to 7 of field 1

put the textstyle of the selectedchunk

   ------> italic

if the specified chunk has mixed textstyle, you get an empty result

put the textstyle of char 3 to 5 of field 1
   ------>.                        i.e. empty

Alex.

On 07/11/2024 15:14, jbv via use-livecode wrote:
> Hi list,
>
> I have a field with a HTMLtext as follows :
>   <p>abc <i>def</i> xyz</p>
>
> the content of the field displays like that :
>   abc def xyz
> with "def" in italic.
>
> Now I select "def" ; the selectedChunk returns
>   char 5 to 7 of field x
>
> Question : how can I know for certain that the
> selection is in italic ?
>
> I tried : char 5 to 7 of the HTMLtext of field x
> but it returns : "bc "
>
> Thank you in advance.
> jbv
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your 
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode



More information about the use-livecode mailing list