Closed davelab6 closed 3 years ago
Second, when I paste my html arabic into a text editor and edit it to make sure its plain text, then it doesn't remove the
;psbn&
clipbboard markup
;psbn&
is not pasteboard markup! It is
in RTL (per #7)
Thanks! Fixes preview 5d3a88e8f81b2a74a2ab9eca771e13c62aaac2c8
Currently the input in the Preview section works via a
<ContentEditable>
element in the TSXhttps://github.com/Tgemayel/variable-fonts-figma/blob/d14b752deaf1af663b7e960bb9fd882843933acb/src/app/components/PreviewSection.tsx#L67-L89
This seems to do odd things with paste.
First, if I copy text from a web page (like going to find some sample arabic text to test #8 :) then it takes HTML on the clipboard and renders it in the preview, but then samsa processes the HTML code:
Second, when I paste my html arabic into a text editor and edit it to make sure its plain text, then it doesn't remove the
;psbn&
clipbboard markup:I guess one solution may be to make the preview read-only, and then have an actual
<input>
element that uses the webkit/OS widget to handle all aspects of pasting correctly.Another might be to make the ContentEditable only accept plain text somehow. I found this but I'm not familiar enough with React to make sense of it :)
https://stackoverflow.com/questions/50132851/contenteditable-plaintext-only-in-a-react-component-with-typescript