Question

using codemirror with markdown mode, how can I have individual classes for all headline levels.

e.g.

# headline <- class cm-header and cm-header-1
## headline level 2 <- class cm-header and cm-header-2

Thanks.

Was it helpful?

Solution 2

I had exactly the same issue, so changed my markdown.js file to look like this Gist. Once you change your mode for this it will append one of 3 different CSS styles as follows:

#Header 1 = .cm-header1
##Header 2 = .cm-header2
###Header 3 = .cm-header3

Hope that helps!

OTHER TIPS

Now implemented in CodeMirror — markdown mode emits classes cm-header1..cm-header6 in addition to cm-header.

See demo: http://codemirror.net/demo/variableheight.html

UPDATE: changed to cm-header-1..cm-header-6 (with dash before number) after 3.21.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top