From a42402f57165d05537de4fb65877310532d7cf9d Mon Sep 17 00:00:00 2001 From: Igarashi Masanao Date: Sat, 17 Feb 2018 23:44:10 +0900 Subject: [PATCH] Rewrite org-rst-verse-block --- ox-rst.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ox-rst.el b/ox-rst.el index e917e6a..b8d7b1c 100644 --- a/ox-rst.el +++ b/ox-rst.el @@ -1501,11 +1501,11 @@ channel." "Transcode a VERSE-BLOCK element from Org to reStructuredText. CONTENTS is verse block contents. INFO is a plist holding contextual information." - (concat - (replace-regexp-in-string "^" "| " (if (> (string-width contents) 1) - (substring contents 0 -1) - contents)) "\n")) - + (let ((lines (split-string contents "\n"))) + (cond ((> (length lines) 0) + (mapconcat + (function (lambda (x) (if (> (string-width x) 0) + (concat "| " x "\n") ""))) lines ""))))) ;;; Filters