yabwe / medium-editor

Medium.com WYSIWYG editor clone. Uses contenteditable API to implement a rich text solution.
https://yabwe.github.io/medium-editor/
Other
16.05k stars 1.85k forks source link

Support auto-capitilzation of first letter within editor #424

Open julianfox opened 9 years ago

julianfox commented 9 years ago

Hello, I have a bug when i associate text-transform: capitalize on first letter with H1 field. I can not write more than one letter... how can i force capitalize on the first letter ?

nmielnik commented 9 years ago

So it looks like conteneditable doesn't work very well when you have

h1:first-letter {
    text-transform: uppercase;
}

Everything acts a bit off when this is set, and with the test page I was trying with my page would actually crash if I tried to edit the first letter. It seems like the issue is with the psuedo selector, as text-transform properties on non-psuedo elements works just fine.

I also tried resetting the property back to inherit and none when the contentedtiable is focused via css, but this still didn't fix the issues.

Also to clarify, this is true about contenteditable in general, even if you remove medium-editor the problem still seems to exist. Let me know if you or someone else finds another way to work around this, so we (or you :) ) can add it into the code base.

julianfox commented 9 years ago

Thank @nmielnik, yes the issue come from contenteditable in general, yes i'll let you know if i have the solution :-)

imerkle commented 7 years ago

is this done yet ??