Posts: 53
Threads: 21
Joined: Jul 2021
I had copied some html into the clipboard (from the browser) which contained <a href="xyz">abc</a> and then in my LA function did print.it(clipboard.Html()); - expecting it would give me the "raw" html code - but I got the same result as with clipboard.Text(); - am I understanding it wrong or could there be a bug?
Posts: 12,073
Threads: 140
Joined: Dec 2002
Example. In Chrome select some text or link. Run this script.
print.it(clipboardData.getHtml());
It prints
<html>
<body>
<!--StartFragment--><strong style="color: rgb(51, 51, 51); font-family: Tahoma, Verdana, Arial, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><a href="https://www.libreautomate.com/forum/forumdisplay.php?fid=19" style="color: rgb(0, 114, 188); text-decoration: none;">Help (LA)</a></strong><!--EndFragment-->
</body>
</html>
It is correct.
Posts: 53
Threads: 21
Joined: Jul 2021
Oh right - I found my fault: I had queried clipboard.text before that - and that "transformed" the content and removed the html. (I had not expected looking at the property would change the clipboard) After moving that line I'm seeing the expected result.
Posts: 12,073
Threads: 140
Joined: Dec 2002
clipboard.text does not change the clipboard data.
print.it(clipboard.text);
print.it("-------");
print.it(clipboardData.getHtml());
Posts: 53
Threads: 21
Joined: Jul 2021
you're right - I got lost in my own code. I had overwritten it myself and did not notice - sorry for spreading invalid statements!