Reputation: 2938
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.
Upvotes: 0
Views: 641
Reputation: 10039
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.
Upvotes: 1
Reputation: 116
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!
Upvotes: 0