CodeMirror CSS allows editing inside the / id class

I want to use CodeMirror to edit CSS and allow the user to allow editing styles within classes or identifiers.

Basically, I want the editor to have only one class.

The first line is the name of the class, and the last line is the closure}. All lines between them can be changed by the user.

Example:

.myclass { /* not editable */
    /* the user can change anything here, add lines and so on */
} /* last line, not editable and no more lines can be inserted afterwards*/

The reason for this is that the user should not change the class name and that the highlighting does not work if the editor does not have the correct syntax.

I know that he can close it inside class c} and open a new class / id, but that doesn't matter in my case.

Thanks in advance!

+3
source share
1 answer

markText (docs) readOnly, . , inclusiveLeft inclusiveRight , / /.

0

All Articles