summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaushal Modi <Kaushal.Modi@gmail.com>2017-12-20 17:15:52 -0500
committerKaushal Modi <Kaushal.Modi@gmail.com>2017-12-20 17:15:52 -0500
commit6e95e088e8a3b5bd41fd6efd8c251b12f6ced61b (patch)
tree748657b583dab8c696cbac756f3841055686d310
parent913aad68c3d91c65cf06568e3e3b0c170caf454d (diff)
parent4f3fc9cb20dc242a4b41b834e68b9ee554554307 (diff)
downloadorg-mode-6e95e088e8a3b5bd41fd6efd8c251b12f6ced61b.tar.gz
Merge branch 'maint'
-rw-r--r--lisp/ox-md.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/ox-md.el b/lisp/ox-md.el
index bd89099..9779419 100644
--- a/lisp/ox-md.el
+++ b/lisp/ox-md.el
@@ -500,14 +500,15 @@ TEXT is the string to transcode. INFO is a plist holding
contextual information."
(when (plist-get info :with-smart-quotes)
(setq text (org-export-activate-smart-quotes text :html info)))
+ ;; The below series of replacements in `text' is order sensitive.
+ ;; Protect `, *, _, and \
+ (setq text (replace-regexp-in-string "[`*_\\]" "\\\\\\&" text))
;; Protect ambiguous #. This will protect # at the beginning of
;; a line, but not at the beginning of a paragraph. See
;; `org-md-paragraph'.
(setq text (replace-regexp-in-string "\n#" "\n\\\\#" text))
;; Protect ambiguous !
(setq text (replace-regexp-in-string "\\(!\\)\\[" "\\\\!" text nil nil 1))
- ;; Protect `, *, _ and \
- (setq text (replace-regexp-in-string "[`*_\\]" "\\\\\\&" text))
;; Handle special strings, if required.
(when (plist-get info :with-special-strings)
(setq text (org-html-convert-special-strings text)))