[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/textile-mode b52abc9ea3 10/19: Better link matching
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/textile-mode b52abc9ea3 10/19: Better link matching |
Date: |
Sat, 29 Jan 2022 08:29:35 -0500 (EST) |
branch: elpa/textile-mode
commit b52abc9ea316dded669105f643ee347b8ff8f5b1
Author: Matus Goljer <dota.keys@gmail.com>
Commit: Matus Goljer <dota.keys@gmail.com>
Better link matching
---
textile-mode.el | 28 +++++++++++++++++++++-------
1 file changed, 21 insertions(+), 7 deletions(-)
diff --git a/textile-mode.el b/textile-mode.el
index c820c9ba43..755f772dec 100644
--- a/textile-mode.el
+++ b/textile-mode.el
@@ -135,12 +135,14 @@ non-matching parentheses"
(defun textile-link-matcher ()
"Return the matcher regexp for a link"
(concat
- "\\(?:"
- "\\(?:" "\".*?\"" "\\|" "\\[.*?\\]" "\\)?"
- textile-url-regexp
- "\\|"
- "\".*?\":[^ \n\t]+"
- "\\)"))
+ "\\(\".*?\"\\):"
+ "\\(?:" "\\(" textile-url-regexp "\\)" "\\|" "\\([^ \n\t]+\\)" "\\)"))
+
+(defun textile-link-alias-matcher ()
+ "Return the matcher regexp for a link ali"
+ (concat
+ "\\(\\[.*?\\]\\)"
+ "\\(" textile-url-regexp "\\)"))
(defun textile-image-matcher ()
"Return the matcher regexp for an image link"
@@ -218,7 +220,14 @@ non-matching parentheses"
`(,(textile-table-matcher) 0 'textile-table-face t t)
;; links
- `(,(textile-link-matcher) 0 'textile-link-face t t)
+ `(,(textile-link-matcher)
+ (1 'textile-link-face)
+ (2 'textile-url-face t t)
+ (3 'textile-lang-face t t))
+ `(,(textile-link-alias-matcher)
+ (1 'textile-lang-face)
+ (2 'textile-url-face))
+ `(,textile-url-regexp 0 'textile-link-face)
;; <pre> blocks
'("<pre>\\(.\\|\n\\)*?</pre>\n?" 0 'textile-pre-face t t)
@@ -388,6 +397,11 @@ non-matching parentheses"
"Face used to highlight links."
:group 'textile-faces)
+(defface textile-url-face
+ '((t (:inherit textile-link-face)))
+ "Face used to highlight links."
+ :group 'textile-faces)
+
(defface textile-image-face
'((t (:foreground "pink")))
"Face used to highlight image links."
- [nongnu] branch elpa/textile-mode created (now a49d9bf421), ELPA Syncer, 2022/01/29
- [nongnu] elpa/textile-mode 37d9b7af86 05/19: Update README.md, ELPA Syncer, 2022/01/29
- [nongnu] elpa/textile-mode a49d9bf421 19/19: Merge pull request #4 from phikal/patch-1, ELPA Syncer, 2022/01/29
- [nongnu] elpa/textile-mode 39be4160bf 11/19: Fix footnote regexp, ELPA Syncer, 2022/01/29
- [nongnu] elpa/textile-mode d511a77c07 09/19: Use defvar over setq, ELPA Syncer, 2022/01/29
- [nongnu] elpa/textile-mode f4d8edca45 12/19: Use different face for inline code, ELPA Syncer, 2022/01/29
- [nongnu] elpa/textile-mode 8abde8f2b0 01/19: Initial commit, ELPA Syncer, 2022/01/29
- [nongnu] elpa/textile-mode c5c3c2c27a 06/19: Fix whitespace, ELPA Syncer, 2022/01/29
- [nongnu] elpa/textile-mode b52abc9ea3 10/19: Better link matching,
ELPA Syncer <=
- [nongnu] elpa/textile-mode 5ca70413c6 07/19: Better <pre> regexp (handles newline after the block for better font-lock), ELPA Syncer, 2022/01/29
- [nongnu] elpa/textile-mode e285f64568 03/19: Update README.md, ELPA Syncer, 2022/01/29
- [nongnu] elpa/textile-mode 0e42bcd0f8 08/19: Made URL regexp non-capturing, ELPA Syncer, 2022/01/29
- [nongnu] elpa/textile-mode 16ac26b5b4 18/19: Fix package header, ELPA Syncer, 2022/01/29
- [nongnu] elpa/textile-mode f3f8fdcba6 14/19: Fix bullet regexp, ELPA Syncer, 2022/01/29
- [nongnu] elpa/textile-mode db33dc5f99 16/19: Merge pull request #2 from syohex/autoload-cookie, ELPA Syncer, 2022/01/29
- [nongnu] elpa/textile-mode 86e45d5a2b 02/19: Initial import, ELPA Syncer, 2022/01/29
- [nongnu] elpa/textile-mode e2e2d7a3d7 04/19: Update README.md, ELPA Syncer, 2022/01/29
- [nongnu] elpa/textile-mode 1b20916b3a 13/19: Add support for imenu for headers, ELPA Syncer, 2022/01/29
- [nongnu] elpa/textile-mode 6865fdec70 15/19: Add autoload cookie for lazy loading, ELPA Syncer, 2022/01/29