소스 검색

ox-ascii: Fix titles with line breaks

* lisp/ox-ascii.el (org-ascii-template--document-title): Take into
  consideration line breaks when computing title's width.
Nicolas Goaziou 10 년 전
부모
커밋
12a63035e9
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      lisp/ox-ascii.el

+ 3 - 1
lisp/ox-ascii.el

@@ -1012,7 +1012,9 @@ INFO is a plist used as a communication channel."
       (let* ((utf8p (eq (plist-get info :ascii-charset) 'utf-8))
 	     ;; Format TITLE.  It may be filled if it is too wide,
 	     ;; that is wider than the two thirds of the total width.
-	     (title-len (min (length title) (/ (* 2 text-width) 3)))
+	     (title-len (min (apply #'max
+				    (mapcar #'length (org-split-string title)))
+			     (/ (* 2 text-width) 3)))
 	     (formatted-title (org-ascii--fill-string title title-len info))
 	     (line
 	      (make-string