Skip to content

Commit

Permalink
Inhibit electric quoting in code spans or blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
phst authored and Jason Blevins committed Jul 10, 2017
1 parent 902be18 commit 8c3bb3f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions markdown-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -8308,6 +8308,14 @@ return the number of paragraphs left to move."
(goto-char start)))))
arg)

(defun markdown--inhibit-electric-quote ()
"Function added to `electric-quote-inhibit-functions'.
Return non-nil if the quote has been inserted inside a code block
or span."
(let ((pos (1- (point))))
(or (markdown-inline-code-at-pos pos)
(markdown-code-block-at-pos pos))))


;;; Extension Framework =======================================================

Expand Down Expand Up @@ -8851,6 +8859,10 @@ position."
(setq-local flyspell-generic-check-word-predicate
#'markdown-flyspell-check-word-p)

;; Electric quoting
(add-hook 'electric-quote-inhibit-functions
#'markdown--inhibit-electric-quote nil :local)

;; Backwards compatibility with markdown-css-path
(when (boundp 'markdown-css-path)
(warn "markdown-css-path is deprecated, see markdown-css-paths.")
Expand Down

0 comments on commit 8c3bb3f

Please sign in to comment.