inconsistency with answer and htmlText?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10330
Joined: Wed May 06, 2009 2:28 pm

inconsistency with answer and htmlText?

Post by dunbarx » Mon Nov 05, 2012 12:17 am

Make a button and a field.

In the field, put a few words, and set the textStyle of one of the words to "bold".
Put this in the button:

Code: Select all

on mouseUp
   get the htmlText of fld 1
   put it
   answer it
end mouseUp
Where did the tags go? They are in msg, and in "it", but not in the answer dialog.

Craig Newman

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10330
Joined: Wed May 06, 2009 2:28 pm

Re: inconsistency with answer and htmlText?

Post by dunbarx » Mon Nov 05, 2012 1:35 am

Me again.

It seems there is a passage in the dictionary that explains this:
Comments:
The prompt can be either formatted text (in the htmlText property's format) or plain text. If the prompt contains p or a start/end tag pair, the answer command assumes the text is in the same format as the htmlText property. Otherwise, the answer command assumes the text is plain text.
But I still do not see why "<b>" is reproduced faithfully, whereas "<p>" is not, as both are "start/end tag pairs".

Craig Newman

Post Reply