I'm populating my CodeMirror textarea with an unformatted string of CSS. I have no control over the formatting of this CSS.
Unformatted CSS example
position: absolute; top: 66px; left: 746px; width: 399px; height: 353px; background-color: pink;
When I set that string as the value of the CodeMirror textarea, it looks like this:
I want it to look like this:
I've tried AutoFormatDateRange but I think that function has been removed?
You should be able to use
.autoFormatRange(), but I think your CSS has to be wrapped in
<style></style> tags for CodeMirror to know how to format your string.
I haven't used CodeMirror this way myself, but inserting your string here didn't work:
But when wrapping it in
<style></style> it was formated as expected.