diff options
| author | Simeon Simeonov | 2023-10-22 14:45:24 +0200 |
|---|---|---|
| committer | Simeon Simeonov | 2023-10-22 14:45:24 +0200 |
| commit | 415d67fe3ac92dc69b34bfe2b2f4a793d0f83e14 (patch) | |
| tree | f6fc4965ad1538dac754e91e61c76211506026f7 | |
| parent | 363c7b265e5fe5358a079e3058a661d23f978fd8 (diff) | |
Upgrade markdown-mode
| -rw-r--r-- | .emacs.d/lisp/markdown-mode.el | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/.emacs.d/lisp/markdown-mode.el b/.emacs.d/lisp/markdown-mode.el index cd066a8..3abecce 100644 --- a/.emacs.d/lisp/markdown-mode.el +++ b/.emacs.d/lisp/markdown-mode.el | |||
| @@ -168,7 +168,7 @@ defined by Markdown and HTML. Increasing this produces extra | |||
| 168 | whitespace on the left. Decreasing it may be preferred when | 168 | whitespace on the left. Decreasing it may be preferred when |
| 169 | fewer than six nested heading levels are used." | 169 | fewer than six nested heading levels are used." |
| 170 | :group 'markdown | 170 | :group 'markdown |
| 171 | :type 'natnump | 171 | :type 'integer |
| 172 | :safe 'natnump | 172 | :safe 'natnump |
| 173 | :package-version '(markdown-mode . "2.4")) | 173 | :package-version '(markdown-mode . "2.4")) |
| 174 | 174 | ||
| @@ -301,7 +301,6 @@ be used." | |||
| 301 | This may be a single string or a list of string. In case of a | 301 | This may be a single string or a list of string. In case of a |
| 302 | list, the first one that satisfies `char-displayable-p' will be | 302 | list, the first one that satisfies `char-displayable-p' will be |
| 303 | used." | 303 | used." |
| 304 | :type 'string | ||
| 305 | :type '(choice | 304 | :type '(choice |
| 306 | (string :tag "Single blockquote display string") | 305 | (string :tag "Single blockquote display string") |
| 307 | (repeat :tag "List of possible blockquote display strings" string)) | 306 | (repeat :tag "List of possible blockquote display strings" string)) |
| @@ -1141,6 +1140,10 @@ If POS is not given, use point instead." | |||
| 1141 | thereis (memq face faces)) | 1140 | thereis (memq face faces)) |
| 1142 | (memq face-prop faces)))) | 1141 | (memq face-prop faces)))) |
| 1143 | 1142 | ||
| 1143 | (defsubst markdown--math-block-p (&optional pos) | ||
| 1144 | (when markdown-enable-math | ||
| 1145 | (markdown--face-p (or pos (point)) '(markdown-math-face)))) | ||
| 1146 | |||
| 1144 | (defun markdown-syntax-propertize-extend-region (start end) | 1147 | (defun markdown-syntax-propertize-extend-region (start end) |
| 1145 | "Extend START to END region to include an entire block of text. | 1148 | "Extend START to END region to include an entire block of text. |
| 1146 | This helps improve syntax analysis for block constructs. | 1149 | This helps improve syntax analysis for block constructs. |
| @@ -2066,7 +2069,7 @@ headers of levels one through six respectively." | |||
| 2066 | '(2.0 1.7 1.4 1.1 1.0 1.0) | 2069 | '(2.0 1.7 1.4 1.1 1.0 1.0) |
| 2067 | "List of scaling values for headers of level one through six. | 2070 | "List of scaling values for headers of level one through six. |
| 2068 | Used when `markdown-header-scaling' is non-nil." | 2071 | Used when `markdown-header-scaling' is non-nil." |
| 2069 | :type 'list | 2072 | :type '(repeat float) |
| 2070 | :initialize #'custom-initialize-default | 2073 | :initialize #'custom-initialize-default |
| 2071 | :set (lambda (symbol value) | 2074 | :set (lambda (symbol value) |
| 2072 | (set-default symbol value) | 2075 | (set-default symbol value) |
| @@ -3589,7 +3592,8 @@ SEQ may be an atom or a sequence." | |||
| 3589 | (when (markdown-search-until-condition | 3592 | (when (markdown-search-until-condition |
| 3590 | (lambda () (and (not (markdown-code-block-at-point-p)) | 3593 | (lambda () (and (not (markdown-code-block-at-point-p)) |
| 3591 | (not (markdown-inline-code-at-point-p)) | 3594 | (not (markdown-inline-code-at-point-p)) |
| 3592 | (not (markdown-in-comment-p)))) | 3595 | (not (markdown-in-comment-p)) |
| 3596 | (not (markdown--math-block-p)))) | ||
| 3593 | markdown-regex-sub-superscript last t) | 3597 | markdown-regex-sub-superscript last t) |
| 3594 | (let* ((subscript-p (string= (match-string 2) "~")) | 3598 | (let* ((subscript-p (string= (match-string 2) "~")) |
| 3595 | (props | 3599 | (props |
| @@ -7856,10 +7860,14 @@ Value is a list of elements describing the link: | |||
| 7856 | (let* ((close-pos (scan-sexps (match-beginning 5) 1)) | 7860 | (let* ((close-pos (scan-sexps (match-beginning 5) 1)) |
| 7857 | (destination-part (string-trim (buffer-substring-no-properties (1+ (match-beginning 5)) (1- close-pos))))) | 7861 | (destination-part (string-trim (buffer-substring-no-properties (1+ (match-beginning 5)) (1- close-pos))))) |
| 7858 | (setq end close-pos) | 7862 | (setq end close-pos) |
| 7859 | (if (string-match "\\([^ ]+\\)\\s-+\\(.+\\)" destination-part) | 7863 | ;; A link can contain spaces if it is wrapped with angle brackets |
| 7860 | (setq url (match-string-no-properties 1 destination-part) | 7864 | (cond ((string-match "\\`<\\(.+\\)>\\'" destination-part) |
| 7861 | title (substring (match-string-no-properties 2 destination-part) 1 -1)) | 7865 | (setq url (match-string-no-properties 1 destination-part))) |
| 7862 | (setq url destination-part)))) | 7866 | ((string-match "\\([^ ]+\\)\\s-+\\(.+\\)" destination-part) |
| 7867 | (setq url (match-string-no-properties 1 destination-part) | ||
| 7868 | title (substring (match-string-no-properties 2 destination-part) 1 -1))) | ||
| 7869 | (t (setq url destination-part))) | ||
| 7870 | (setq url (url-unhex-string url)))) | ||
| 7863 | ;; Reference link at point. | 7871 | ;; Reference link at point. |
| 7864 | ((thing-at-point-looking-at markdown-regex-link-reference) | 7872 | ((thing-at-point-looking-at markdown-regex-link-reference) |
| 7865 | (setq bang (match-string-no-properties 1) | 7873 | (setq bang (match-string-no-properties 1) |
