Skip to content

Commit

Permalink
Fix check for point inside link
Browse files Browse the repository at this point in the history
Fixes GH-161
  • Loading branch information
jrblevin committed Aug 30, 2016
1 parent 13bec1a commit 3f11a4a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions markdown-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -6421,9 +6421,9 @@ This is an exact copy of `line-number-at-pos' for use in emacs21."
(forward-line 0)
(1+ (count-lines start (point))))))

(defun markdown-inside-link-text-p ()
"Return nil if not currently within link anchor text."
(looking-back "\\[[^]]*" nil))
(defun markdown-inside-link-p ()
"Return t if point is within a link."
(thing-at-point-looking-at (markdown-make-regex-link-generic)))

(defun markdown-line-is-reference-definition-p ()
"Return whether the current line is a (non-footnote) reference defition."
Expand Down Expand Up @@ -6767,7 +6767,7 @@ or \\[markdown-toggle-inline-images]."
;; Separating out each condition into a separate function so that users can
;; override if desired (with remove-hook)
(add-hook 'fill-nobreak-predicate
'markdown-inside-link-text-p nil t)
'markdown-inside-link-p nil t)
(add-hook 'fill-nobreak-predicate
'markdown-line-is-reference-definition-p nil t)

Expand Down

0 comments on commit 3f11a4a

Please sign in to comment.