Skip trimming newline in paragraph

This commit is contained in:
Takuya OBUCHI 2016-05-21 03:56:56 +09:00
parent 4889adc219
commit f7b76d5a78

View File

@ -73,14 +73,11 @@
"Transcode PARAGRAPH element into Github Flavoured Markdown format. "Transcode PARAGRAPH element into Github Flavoured Markdown format.
CONTENTS is the paragraph contents. INFO is a plist used as a CONTENTS is the paragraph contents. INFO is a plist used as a
communication channel." communication channel."
(let ((contents (let ((first-object (car (org-element-contents paragraph))))
(concat (mapconcat 'identity (split-string contents) " ") ;; If paragraph starts with a #, protect it.
"\n"))) (if (and (stringp first-object) (string-match "\\`#" first-object))
(let ((first-object (car (org-element-contents paragraph)))) (replace-regexp-in-string "\\`#" "\\#" contents nil t)
;; If paragraph starts with a #, protect it. contents)))
(if (and (stringp first-object) (string-match "\\`#" first-object))
(replace-regexp-in-string "\\`#" "\\#" contents nil t)
contents))))
;;;; Src Block ;;;; Src Block