Skip to content

Instantly share code, notes, and snippets.

@exaos
Forked from fasheng/join-chinese.el
Created October 5, 2013 07:21
Show Gist options
  • Save exaos/6837803 to your computer and use it in GitHub Desktop.
Save exaos/6837803 to your computer and use it in GitHub Desktop.
(defadvice org-html-paragraph (before fsh-org-html-paragraph-advice
(paragraph contents info) activate)
"Join consecutive Chinese lines into a single long line without
unwanted space when exporting org-mode to html."
(let ((fixed-contents)
(orig-contents (ad-get-arg 1))
(reg-han "[[:multibyte:]]"))
(setq fixed-contents (replace-regexp-in-string
(concat "\\(" reg-han "\\) *\n *\\(" reg-han "\\)")
"\\1\\2" orig-contents))
(ad-set-arg 1 fixed-contents)
))

this is a sentence

你好, 我是 某某

Hello, I’m, 某某

他说: “很高兴见到你”

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment