From ef4424bda67302083889d6220d8f8265772c8ee5 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 7 Aug 2019 23:36:21 -0400 Subject: [PATCH] input/{chinese,japanese}: fix org-html advice regexp #1649 --- modules/input/chinese/config.el | 10 +++++++--- modules/input/japanese/config.el | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/modules/input/chinese/config.el b/modules/input/chinese/config.el index b74f84d15..204bc0513 100644 --- a/modules/input/chinese/config.el +++ b/modules/input/chinese/config.el @@ -36,11 +36,15 @@ when exporting org-mode to html." :filter-args #'org-html-paragraph (cl-destructuring-bind (paragraph contents info) args - (let* ((fix-regexp "[[:multibyte:]]") + (let* ((fix-regexp "[[:multibyte:]a-zA-Z0-9]") (origin-contents contents) (fixed-contents (replace-regexp-in-string - (concat "\\(" fix-regexp "\\) *\n *\\(" fix-regexp "\\)") - "\\1\\2" + (concat "\\(" + fix-regexp + "\\) *\\(<[Bb][Rr] */>\\)?\n *\\(" + fix-regexp + "\\)") + "\\1\\3" origin-contents))) (list paragraph fixed-contents info)))) diff --git a/modules/input/japanese/config.el b/modules/input/japanese/config.el index dcdbdb0d5..e94078c00 100644 --- a/modules/input/japanese/config.el +++ b/modules/input/japanese/config.el @@ -46,11 +46,15 @@ when exporting org-mode to html." :filter-args #'org-html-paragraph (cl-destructuring-bind (paragraph contents info) args - (let* ((fix-regexp "[[:multibyte:]]") + (let* ((fix-regexp "[[:multibyte:]a-zA-Z0-9]") (origin-contents contents) (fixed-contents (replace-regexp-in-string - (concat "\\(" fix-regexp "\\) *\n *\\(" fix-regexp "\\)") - "\\1\\2" + (concat "\\(" + fix-regexp + "\\) *\\(<[Bb][Rr] */>\\)?\n *\\(" + fix-regexp + "\\)") + "\\1\\3" origin-contents))) (list paragraph fixed-contents info))))