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,15 +31,16 @@
;; ;;
;;; 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
(let* ((fix-regexp "[[:multibyte:]]") (cl-destructuring-bind (paragraph contents info) args
(origin-contents contents) (let* ((fix-regexp "[[:multibyte:]]")
(fixed-contents (origin-contents contents)
(replace-regexp-in-string (fixed-contents
(concat "\\(" fix-regexp "\\) *\n *\\(" fix-regexp "\\)") (replace-regexp-in-string
"\\1\\2" (concat "\\(" fix-regexp "\\) *\n *\\(" fix-regexp "\\)")
origin-contents))) "\\1\\2"
(list paragraph fixed-contents info))) origin-contents)))
(list paragraph fixed-contents info))))

View file

@ -41,15 +41,16 @@
;; ;;
;;; 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
(let* ((fix-regexp "[[:multibyte:]]") (cl-destructuring-bind (paragraph contents info) args
(origin-contents contents) (let* ((fix-regexp "[[:multibyte:]]")
(fixed-contents (origin-contents contents)
(replace-regexp-in-string (fixed-contents
(concat "\\(" fix-regexp "\\) *\n *\\(" fix-regexp "\\)") (replace-regexp-in-string
"\\1\\2" (concat "\\(" fix-regexp "\\) *\n *\\(" fix-regexp "\\)")
origin-contents))) "\\1\\2"
(list paragraph fixed-contents info))) origin-contents)))
(list paragraph fixed-contents info))))