Fix bug in heading detection code.

This commit is contained in:
millejoh 2015-02-15 09:31:23 -06:00
parent d52cc9a662
commit 9bfbf5544c

View file

@ -252,7 +252,7 @@ auto-execution mode flag in the connected buffer is `t'.")))
(defun ein:preprocess-nb4-cell (cell-data)
(let ((source (plist-get cell-data :source)))
(when (and (string= (plist-get cell-data :cell_type) "markdown")
(string-match "\\(^#*\\)" source))
(string-match "\\(^#+\\)" source))
(let ((heading-level (match-end 0)))
(plist-put cell-data :cell_type "heading")
(plist-put cell-data :level heading-level)