emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/textile-mode c0cd67c7cf 1/3: Account for beginning/end of


From: ELPA Syncer
Subject: [nongnu] elpa/textile-mode c0cd67c7cf 1/3: Account for beginning/end of line in "inline code"
Date: Mon, 12 Feb 2024 13:01:34 -0500 (EST)

branch: elpa/textile-mode
commit c0cd67c7cfdb1562e2984a7391f9aa70036de66c
Author: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Commit: Konstantin Kharlamov <Hi-Angel@yandex.ru>

    Account for  beginning/end of line in "inline code"
    
    Before this commit a @foo@ at the end or beginning of the buffer
    wouldn't be highlighted. Now it is.
---
 textile-mode.el | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/textile-mode.el b/textile-mode.el
index 727317d382..ce968f8849 100644
--- a/textile-mode.el
+++ b/textile-mode.el
@@ -69,6 +69,12 @@ non-matching parentheses"
 (defvar textile-table-alignments
       '( "<>" "<" ">" "=" "_" "\\^" "~" "\\\\[0-9]+" "/[0-9]+"))
 
+(defconst textile-re-nonword-start "\\(?:^\\|\\W\\)"
+  "Non-word character or start of line")
+
+(defconst textile-re-nonword-end "\\(?:\\W\\|$\\)"
+  "Non-word character or end of line")
+
 ; from gnus-button-url-regexp
 (defvar textile-url-regexp 
"\\(?:\\b\\(?:\\(?:www\\.\\|\\(?:s?https?\\|ftp\\|file\\|gopher\\|nntp\\|news\\|telnet\\|wais\\|mailto\\|info\\):\\)\\(?://[-a-z0-9_.]+:[0-9]*\\)?[-a-z0-9_=!?#$@~%&*+\\/:;.,[:word:]]+[-a-z0-9_=#$@~%&*+\\/[:word:]]\\)\\)"
   "Regexp matching a URL.")
@@ -106,11 +112,13 @@ non-matching parentheses"
 (defun textile-inline-code-matcher (markup)
   "Return the matcher regexp for an inline code"
   (concat
-   "\\W\\("
+   textile-re-nonword-start
+   "\\("
    markup
    ".+?"
    markup
-   "\\)\\W"))
+   "\\)"
+   textile-re-nonword-end))
 
 (defun textile-list-bullet-matcher (bullet)
   "Return the matcher regexp for a list bullet"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]