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

@ -31,10 +31,11 @@
;; ;;
;;; Hacks ;;; Hacks
(defadvice! +chinese--org-html-paragraph-a (paragraph contents info) (defadvice! +chinese--org-html-paragraph-a (args)
"Join consecutive Chinese lines into a single long line without unwanted space "Join consecutive Chinese lines into a single long line without unwanted space
when exporting org-mode to html." when exporting org-mode to html."
:filter-args #'org-html-paragraph :filter-args #'org-html-paragraph
(cl-destructuring-bind (paragraph contents info) args
(let* ((fix-regexp "[[:multibyte:]]") (let* ((fix-regexp "[[:multibyte:]]")
(origin-contents contents) (origin-contents contents)
(fixed-contents (fixed-contents
@ -42,4 +43,4 @@ when exporting org-mode to html."
(concat "\\(" fix-regexp "\\) *\n *\\(" fix-regexp "\\)") (concat "\\(" fix-regexp "\\) *\n *\\(" fix-regexp "\\)")
"\\1\\2" "\\1\\2"
origin-contents))) origin-contents)))
(list paragraph fixed-contents info))) (list paragraph fixed-contents info))))

View file

@ -41,10 +41,11 @@
;; ;;
;;; Hacks ;;; 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 "Join consecutive Japanese lines into a single long line without unwanted space
when exporting org-mode to html." when exporting org-mode to html."
:filter-args #'org-html-paragraph :filter-args #'org-html-paragraph
(cl-destructuring-bind (paragraph contents info) args
(let* ((fix-regexp "[[:multibyte:]]") (let* ((fix-regexp "[[:multibyte:]]")
(origin-contents contents) (origin-contents contents)
(fixed-contents (fixed-contents
@ -52,4 +53,4 @@ when exporting org-mode to html."
(concat "\\(" fix-regexp "\\) *\n *\\(" fix-regexp "\\)") (concat "\\(" fix-regexp "\\) *\n *\\(" fix-regexp "\\)")
"\\1\\2" "\\1\\2"
origin-contents))) origin-contents)))
(list paragraph fixed-contents info))) (list paragraph fixed-contents info))))