input/{chinese,japanese}: fix #1649

This commit is contained in:
Henrik Lissner 2019-08-07 17:07:36 -04:00
parent 30d5eff10a
commit b2aec5f546
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 20 additions and 18 deletions

View file

@ -41,15 +41,16 @@
;;
;;; Hacks
(defadvice! +japanese--org-html-paragraph-a (paragraph contents info)
(defadvice! +japanese--org-html-paragraph-a (args)
"Join consecutive Japanese lines into a single long line without unwanted space
when exporting org-mode to html."
:filter-args #'org-html-paragraph
(let* ((fix-regexp "[[:multibyte:]]")
(origin-contents contents)
(fixed-contents
(replace-regexp-in-string
(concat "\\(" fix-regexp "\\) *\n *\\(" fix-regexp "\\)")
"\\1\\2"
origin-contents)))
(list paragraph fixed-contents info)))
(cl-destructuring-bind (paragraph contents info) args
(let* ((fix-regexp "[[:multibyte:]]")
(origin-contents contents)
(fixed-contents
(replace-regexp-in-string
(concat "\\(" fix-regexp "\\) *\n *\\(" fix-regexp "\\)")
"\\1\\2"
origin-contents)))
(list paragraph fixed-contents info))))