CodeFlask icon indicating copy to clipboard operation
CodeFlask copied to clipboard

Abnormal Letter-Spacing misplaces caret

Open ultimate-tester opened this issue 5 years ago • 4 comments

Quite simple problem, having an abnormal letter-spacing will prevent the caret aligning properly. The CSS used by CodeFlash should reset the letter-spacing to the default, which is letter-spacing: normal;

image

ultimate-tester avatar Feb 20 '20 21:02 ultimate-tester

See below - this same problem exists with a stock standard markdown highlighted example. Problem persists even when setting letter-spacing: normal; for all elements.

example

See the following pen: https://codepen.io/brentkelly/pen/gOabdmQ

NB: https://github.com/ClickSimply/nanoEditor doesn't seem to suffer this issue.

brentkelly avatar Apr 11 '20 13:04 brentkelly

CodeFlask works by syncing textarea text with highlighted editor text. So any differences in letter-spacing (or any other font or spacing CSS properties) will misplace caret.

In your case you changed letter-spacing in your project CSS on purpose? Or was it a side-effect of a CSS meant to style other part of your project?

kazzkiq avatar Jun 04 '20 20:06 kazzkiq

CodeFlask works by syncing textarea text with highlighted editor text. So any differences in letter-spacing (or any other font or spacing CSS properties) will misplace caret.

In your case you changed letter-spacing in your project CSS on purpose? Or was it a side-effect of a CSS meant to style other part of your project?

Thanks for responding. In my case it was the latter. Other CSS in my project caused this as a side effect. My advice is to reset the letter-spacing (or take it into account) for CodeFlask.

ultimate-tester avatar Jun 04 '20 20:06 ultimate-tester

Yep. But the issue is that other styles can still leak into CodeFlask editor. Is basically a non-ending nightmare when you run without sandboxed code.

I believe this kind of issue will vanish with #119.

kazzkiq avatar Jun 05 '20 01:06 kazzkiq