On Jul 8, 2015, at 11:58 AM, Richard Gaskin <ambassa...@fourthworld.com> wrote:

> Replacing a single character should ideally only affect the text style for 
> that character, even if it occurs in multiple places, so personally I would 
> consider the second example a bug if it strips all styles from unaffected 
> portions of the text.

This comment appears in the dictionary entry for replace:

"Important! You can use the replace command on a field, but doing so removes 
any formatting (fonts, styles, colors, and sizes) in the field. To work around 
this limitation, use the field's htmlText property as the source for 
replacement instead of using the field itself as the source.”

So it’s intentional. I suspect that speed is the issue here. Replace is dang 
fast, and I wouldn’t want it to be slowed down by forcing it to consider 
formatting. Especially when there are simple workarounds like the htmlText 
trick above or using replaceText().

Devin


Devin Asay
Office of Digital Humanities
Brigham Young University


_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to