[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/adoc-mode ab42f4909a 107/199: (un)constrained quotes can n
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/adoc-mode ab42f4909a 107/199: (un)constrained quotes can now spawn more than two lines |
Date: |
Sun, 3 Sep 2023 06:59:38 -0400 (EDT) |
branch: elpa/adoc-mode
commit ab42f4909a769f3c021813b2970322d7869f54dd
Author: sensorflo <sensorflo@gmail.com>
Commit: sensorflo <sensorflo@gmail.com>
(un)constrained quotes can now spawn more than two lines
---
adoc-mode-test.el | 16 +++++++++++-----
adoc-mode.el | 26 ++++++++++++++++++++++++--
2 files changed, 35 insertions(+), 7 deletions(-)
diff --git a/adoc-mode-test.el b/adoc-mode-test.el
index 836a5eeeae..7eb6371754 100644
--- a/adoc-mode-test.el
+++ b/adoc-mode-test.el
@@ -449,11 +449,17 @@ removed before TRANSFORM is evaluated.
(ert-deftest adoctest-test-quotes-medium ()
(adoctest-faces "test-quotes-medium"
;; test wheter constrained/unconstrained quotes can spawn multiple lines
- "Lorem " 'no-face "*" markup-meta-hide-face "ipsum" markup-strong-face "\n"
nil
- "dolor" markup-strong-face "*" markup-meta-hide-face " sit" 'no-face "\n"
nil
- "Lorem " 'no-face "__" markup-meta-hide-face "ipsum" markup-emphasis-face
"\n" nil
- "dolor" markup-emphasis-face "__" markup-meta-hide-face " sit" 'no-face
"\n" nil
- "\n" nil
+ "Lorem " 'no-face "*" markup-meta-hide-face "ipsum" markup-strong-face
+ "\n" nil "dolor" markup-strong-face "\n" nil "dolor" markup-strong-face
+ "\n" nil "dolor" markup-strong-face "\n" nil "dolor" markup-strong-face
+ "*" markup-meta-hide-face
+ " sit" 'no-face "\n" nil
+
+ "Lorem " 'no-face "__" markup-meta-hide-face "ipsum" markup-emphasis-face
+ "\n" nil "dolor" markup-emphasis-face "\n" nil "dolor" markup-emphasis-face
+ "\n" nil "dolor" markup-emphasis-face "\n" nil "dolor" markup-emphasis-face
+ "__" markup-meta-hide-face
+ " sit" 'no-face "\n" nil
;; tests border case that delimiter is at the beginnin/end of an
paragraph/line
;; constrained at beginning
diff --git a/adoc-mode.el b/adoc-mode.el
index 36b140157b..0ec9216885 100644
--- a/adoc-mode.el
+++ b/adoc-mode.el
@@ -1122,7 +1122,7 @@ NOT-ALLOWED-CHARS are chars not allowed before the quote."
(adoc-re-quote-precondition "")
"\\(\\[[^][]+?\\]\\)?"
"\\(" qldel "\\)"
- "\\(.+?\\(?:\n.*?\\)\\{,1\\}?\\)"
+ "\\(" (adoc-re-content "+") "\\)"
"\\(" qrdel "\\)")))
;; AsciiDoc src for constrained quotes
@@ -1149,7 +1149,7 @@ subgroups:
(adoc-re-quote-precondition "A-Za-z0-9;:}&<>")
"\\(\\[[^][]+?\\]\\)?"
"\\(" qldel "\\)"
- "\\([^ \t\n]\\|[^ \t\n].*?\\(?:\n.*?\\)\\{,1\\}?[^ \t\n]\\)"
+ "\\([^ \t\n]\\|[^ \t\n]" (adoc-re-content) "[^ \t\n]\\)"
"\\(" qrdel "\\)"
;; BUG: now that Emacs doesn't has look-ahead, the match is too long, and
;; adjancted quotes of the same type wouldn't be recognized.
@@ -1273,6 +1273,28 @@ Subgroups of returned regexp:
(style "[demshalv]"))
(concat "\\(?:" fullspan "\\)?\\(?:" align "\\)?\\(?:" style "\\)?")))
+;; bug: if qualifier is "+", and the thing to match starts at the end of a
+;; line (i.e. the first char is newline), then wrongly this regexp does
+;; never match.
+;; Note: asciidoc uses Python's \s to determine blank lines, while _not_
+;; setting either the LOCALE or UNICODE flag, see
+;; Reader.skip_blank_lines. Python uses [ \t\n\r\f\v] for it's \s . So
+;; the horizontal spaces are [ \t].
+(defun adoc-re-content (&optional qualifier)
+ "Matches content, possibly spawning multiple non-blank lines"
+ (concat
+ "\\(?:"
+ ;; content on initial line
+ "." (or qualifier "*") "?"
+ ;; if content spawns multiple lines
+ "\\(?:\n"
+ ;; complete non blank lines
+ "\\(?:[ \t]*\\S-.*\n\\)*?"
+ ;; leading content on last line
+ ".*?"
+ "\\)??"
+ "\\)"))
+
;;;; font lock keywords
(defun adoc-kwf-std (end regexp &optional must-free-groups no-block-del-groups)
- [nongnu] elpa/adoc-mode 303019657d 060/199: many things with xref and anchor, (continued)
- [nongnu] elpa/adoc-mode 303019657d 060/199: many things with xref and anchor, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 6cb42436d2 067/199: test: running the test is now more smoothly, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 838684c227 068/199: comment improvements, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 950223b614 070/199: reworked highlighting of urls, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode d80b29ebc9 072/199: test: bugfix: point was wronly positioned in adoctest-trans, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 63abada690 074/199: test: adoctest-trans learned setting mark using <>, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 0a35871ac3 083/199: edited (doc-)comments to make it fit package format guidelines, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 2bbd6a36ac 088/199: bumped version to 0.6.2, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode b6d54d9007 097/199: bumped version to 0.6.4, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode b508984663 106/199: id attribute of footnoteref now uses markup-internal-reference-face if it's used as reference opposed to anchor, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode ab42f4909a 107/199: (un)constrained quotes can now spawn more than two lines,
ELPA Syncer <=
- [nongnu] elpa/adoc-mode 61974788b4 109/199: small reformatting, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 2bcfcea743 112/199: improved comments, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 9916b51199 113/199: small refactoring in field of the adoc-attribute-list text property, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 9957855384 115/199: bumpded version to 0.6.6, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 414e920433 121/199: Avoid some compilation warnings., ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 141af8c56a 123/199: Associate with .adoc and .asciidoc, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 474b8f0878 126/199: Correct links, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 66cd5645a0 130/199: Clean up the front-matter, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 183e983a5d 161/199: [Fix #17] Don't add non-title entries to imenu (#18), ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode a5c982d123 170/199: [Fix #14] Add standard GH templates, ELPA Syncer, 2023/09/03