branch: elpa/adoc-mode
commit c2e55f90ba798f93c855c48718461daf67a83f06
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>
Remove deprecated backtick-apostrophe quote styles
Asciidoctor does not support the old AsciiDoc ``text'' (double
quoted) and `text' (single quoted) syntaxes. Remove the
corresponding font-lock rules and tests. Backtick inline code
(`text`) is handled in the passthrough section.
---
CHANGELOG.md | 1 +
adoc-mode.el | 37 +++++++++++++------------------------
test/adoc-mode-test.el | 3 ---
3 files changed, 14 insertions(+), 27 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 34c6fdaa4b..48869f3327 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,7 @@
- Require Emacs 28.1.
- `adoc-enable-two-line-title` now defaults to nil (Asciidoctor deprecated
Setext-style titles).
+- Remove deprecated AsciiDoc backtick-apostrophe quote styles (`` ``text'' ``
and `` `text' ``), which are not supported in Asciidoctor.
### Bugs fixed
diff --git a/adoc-mode.el b/adoc-mode.el
index 966bd4e460..0f8b6a78e5 100644
--- a/adoc-mode.el
+++ b/adoc-mode.el
@@ -2419,25 +2419,15 @@ Use this function as matching function MATCHER in
`font-lock-keywords'."
;; 7. Replacements2
- ;; (passthrough stuff removal)
- ;; ------------------------
- ;; todo. look in asciidoc source how exactly asciidoc does it
- ;; 1) BUG: actually only ifdef::no-inline-literal[]
- ;; 2) TODO: in asciidod.conf (but not yet here) also in inline macro section
-
- ;; AsciiDoc Manual: constitutes an inline literal passthrough. The enclosed
- ;; text is rendered in a monospaced font and is only subject to special
- ;; character substitution.
- (adoc-kw-quote 'adoc-unconstrained "``" adoc-typewriter-face nil nil t)
;1)
- (adoc-kw-quote 'adoc-constrained "`" adoc-typewriter-face nil nil t) ;1)
- ;; AsciiDoc Manual: The triple-plus passthrough is functionally identical to
- ;; the pass macro but you don’t have to escape ] characters and you can
- ;; prefix with quoted attributes in the inline version
- (adoc-kw-quote 'adoc-unconstrained "+++" adoc-typewriter-face nil nil t) ;2)
- ;;The double-dollar passthrough is functionally identical to the triple-plus
- ;;passthrough with one exception: special characters are escaped.
- (adoc-kw-quote 'adoc-unconstrained "$$" adoc-typewriter-face nil nil t) ;2)
- ;; TODO: add pass:[...], latexmath:[...], asciimath[...]
+ ;; Inline code and passthroughs
+ ;; ----------------------------
+ ;; Asciidoctor: `text` is inline code (monospace literal)
+ (adoc-kw-quote 'adoc-unconstrained "``" adoc-typewriter-face nil nil t)
+ (adoc-kw-quote 'adoc-constrained "`" adoc-typewriter-face nil nil t)
+ ;; +++text+++ passthrough (no substitutions)
+ (adoc-kw-quote 'adoc-unconstrained "+++" adoc-typewriter-face nil nil t)
+ ;; $$text$$ passthrough (special characters escaped)
+ (adoc-kw-quote 'adoc-unconstrained "$$" adoc-typewriter-face nil nil t)
;; special characters
;; ------------------
@@ -2450,11 +2440,10 @@ Use this function as matching function MATCHER in
`font-lock-keywords'."
;; ------------------------------
(adoc-kw-quote 'adoc-unconstrained "**" adoc-bold-face)
(adoc-kw-quote 'adoc-constrained "*" adoc-bold-face)
- (adoc-kw-quote 'adoc-constrained "``" nil adoc-replacement-face "''") ;
double quoted text
- (adoc-kw-quote 'adoc-constrained "'" adoc-emphasis-face) ; single
quoted text
- (adoc-kw-quote 'adoc-constrained "`" nil adoc-replacement-face "'")
- ;; `...` , +++...+++, $$...$$ are within passthrough stuff above
- (adoc-kw-quote 'adoc-unconstrained "++" adoc-typewriter-face) ; AsciiDoc
manual: really only '..are rendered in a monospaced font.'
+ ;; The old AsciiDoc ``text'' (double quote) and `text' (single quote)
+ ;; syntaxes are deprecated in Asciidoctor. Backtick inline code is
+ ;; handled in the passthrough section above.
+ (adoc-kw-quote 'adoc-unconstrained "++" adoc-typewriter-face)
(adoc-kw-quote 'adoc-constrained "+" adoc-typewriter-face)
(adoc-kw-quote 'adoc-unconstrained "__" adoc-emphasis-face)
(adoc-kw-quote 'adoc-constrained "_" adoc-emphasis-face)
diff --git a/test/adoc-mode-test.el b/test/adoc-mode-test.el
index a62d60728e..340c6611da 100644
--- a/test/adoc-mode-test.el
+++ b/test/adoc-mode-test.el
@@ -594,9 +594,6 @@ Don't use it for anything real.")
"Lorem " nil "$$" adoc-meta-hide-face " ipsum "
'(adoc-typewriter-face adoc-verbatim-face) "$$" adoc-meta-hide-face " dolor\n"
nil
"Lorem " nil "**" adoc-meta-hide-face " ipsum "
adoc-bold-face "**" adoc-meta-hide-face " dolor\n" nil
"Lorem " nil "*" adoc-meta-hide-face "ipsum" adoc-bold-face
"*" adoc-meta-hide-face " dolor\n" nil
- "Lorem " nil "``" adoc-replacement-face "ipsum" nil "''"
adoc-replacement-face " dolor\n" nil
- "Lorem " nil "'" adoc-meta-hide-face "ipsum"
adoc-emphasis-face "'" adoc-meta-hide-face " dolor\n" nil
- "Lorem " nil "`" adoc-replacement-face "ipsum" nil "'"
adoc-replacement-face " dolor\n" nil
"Lorem " nil "++" adoc-meta-hide-face " ipsum "
adoc-typewriter-face "++" adoc-meta-hide-face " dolor\n" nil
"Lorem " nil "+" adoc-meta-hide-face "ipsum"
adoc-typewriter-face "+" adoc-meta-hide-face " dolor\n" nil
"Lorem " nil "__" adoc-meta-hide-face " ipsum "
adoc-emphasis-face "__" adoc-meta-hide-face " dolor\n" nil