mirror of
				https://github.com/larstvei/ox-gfm.git
				synced 2025-11-03 23:20:12 +00:00 
			
		
		
		
	When preserve-breaks is set on, skip trimming newline in paragraph
This commit is contained in:
		
							parent
							
								
									f7b76d5a78
								
							
						
					
					
						commit
						2feeb57a8d
					
				@ -69,10 +69,13 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
;;;; Paragraph
 | 
					;;;; Paragraph
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(defun org-gfm-paragraph (paragraph contents _info)
 | 
					(defun org-gfm-paragraph (paragraph contents info)
 | 
				
			||||||
  "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."
 | 
				
			||||||
 | 
					  (unless (plist-get info :preserve-breaks)
 | 
				
			||||||
 | 
					    (setq contents (concat (mapconcat 'identity (split-string contents) " ")
 | 
				
			||||||
 | 
					                 "\n")))
 | 
				
			||||||
  (let ((first-object (car (org-element-contents paragraph))))
 | 
					  (let ((first-object (car (org-element-contents paragraph))))
 | 
				
			||||||
    ;; If paragraph starts with a #, protect it.
 | 
					    ;; If paragraph starts with a #, protect it.
 | 
				
			||||||
    (if (and (stringp first-object) (string-match "\\`#" first-object))
 | 
					    (if (and (stringp first-object) (string-match "\\`#" first-object))
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user