Chat and textarea formatting
Alex Tweedly
alex at tweedly.net
Thu Feb 16 17:55:11 EST 2023
Of course, the other option - depending on your timescale (and maybe
your license) - would be to build it as a LC app, and then 'build for web'.
That way you'd have control over the formatting options you want to
allow/provide.
Alex
P.S. but then, I'm strongly averse to any use of JS, HTML, etc. because
I just don't like using them and would go out of my way to do
everything in LC if possible :-) I am holding my breath for next DPs of
LC for web.
Your mileage, and your dislike of non-LC languages, may vary.
On 15/02/2023 16:32, harrison--- via use-livecode wrote:
> Hi Richard,
>
> It takes care of the line spacing problem fine which is good!
>
> It doesnt like apostrophes in words, and returns garbage for that.
>
> It doesnt keep any bold facing or text coloring information.
>
> Thanks for this suggestion.
>
> Rick
>
>
>
>> On Feb 15, 2023, at 4:52 AM, Richard Gaskin via use-livecode <use-livecode at lists.runrev.com> wrote:
>>
>> You may find it easier to set the contenteditable property of a container element like div or p, and then you can retrieve the inner HTML of that element with:
>>
>> var tFldMainHTML = document.getElementById("fldMain").innerHTML
>>
>> Save the example below to a text file and run in your browser. There's extra stuff there just for appearance, but the meat of it is that one line.
>>
>> Once the page is loaded, copy some styled text and paste it into the field. When the button's clicked you'll see the full HTML tags in an alert dialog.
> _______________________________________________
> 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