Skip to content

Commit

Permalink
Check getting yaml meta-data value
Browse files Browse the repository at this point in the history
If it cannot be got, it raises exception. This is work around of #156.
  • Loading branch information
syohex committed Aug 4, 2016
1 parent 3ba1851 commit b8d76c9
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions markdown-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -5542,13 +5542,14 @@ setext header, but should not be folded."
(goto-char (point-min))
;; Unhide any false positives in metadata blocks
(when (markdown-text-property-at-point 'markdown-yaml-metadata-begin)
(let* ((body (progn (forward-line)
(markdown-text-property-at-point
'markdown-yaml-metadata-section)))
(end (progn (goto-char (cl-second body))
(let ((body (progn (forward-line)
(markdown-text-property-at-point
'markdown-yaml-metadata-end))))
(outline-flag-region (point-min) (1+ (cl-second end)) nil)))
'markdown-yaml-metadata-section))))
(when body
(let ((end (progn (goto-char (cl-second body))
(markdown-text-property-at-point
'markdown-yaml-metadata-end))))
(outline-flag-region (point-min) (1+ (cl-second end)) nil)))))
;; Hide any false positives in code blocks
(unless (outline-on-heading-p)
(outline-next-visible-heading 1))
Expand Down

0 comments on commit b8d76c9

Please sign in to comment.