Improve consistency in the usage of empty lines

This commit is contained in:
Jonas Bernoulli 2023-06-26 14:07:35 +02:00
parent 46faa67dbb
commit 4eaf2adf29
No known key found for this signature in database
GPG Key ID: 230C2EFBB326D927

View File

@ -29,6 +29,7 @@
(require 'ox-md)
(require 'ox-publish)
;;; User-Configurable Variables
@ -62,7 +63,6 @@
(table-row . org-gfm-table-row)
(table . org-gfm-table)))
;;; Transcode Functions
@ -80,7 +80,6 @@ communication channel."
(replace-regexp-in-string "\\`#" "\\#" contents nil t)
contents)))
;;;; Src Block
(defun org-gfm-src-block (src-block contents info)
@ -97,7 +96,6 @@ channel."
(defalias 'org-gfm-example-block #'org-gfm-src-block)
;;;; Strike-Through
(defun org-gfm-strike-through (strike-through contents info)
@ -106,7 +104,6 @@ CONTENTS is the text with strike-through markup. INFO is a plist
holding contextual information."
(format "~~%s~~" contents))
;;;; Table-Common
(defvar width-cookies nil)
@ -149,7 +146,6 @@ the column."
info)
(puthash column max-width width-cookies))))))
(defun org-gfm-make-hline-builder (table info char)
"Return a function to build horizontal line in TABLE with given
CHAR. INFO is a plist used as a communication channel."
@ -159,7 +155,6 @@ CHAR. INFO is a plist used as a communication channel."
(setq max-width 1))
(make-string max-width ,char))))
;;;; Table-Cell
(defun org-gfm-table-cell (table-cell contents info)
@ -177,7 +172,6 @@ of the cell. INFO is a plist used as a communication channel."
?\s)))
(concat left-border contents right-border)))
;;;; Table-Row
(defun org-gfm-table-row (table-row contents info)
@ -202,8 +196,6 @@ channel."
gfm-table-right-border))))
contents))
;;;; Table
(defun org-gfm-table (table contents info)
@ -231,7 +223,6 @@ contextual information."
(concat (when no-header (funcall build-dummy-header))
(replace-regexp-in-string "\n\n" "\n" contents))))
;;;; Table of contents
(defun org-gfm-format-toc (headline)
@ -245,7 +236,6 @@ plist used as a communication channel."
(org-export-get-reference headline info))))
(concat indent "- [" title "]" "(#" anchor ")")))
;;;; Footnote section
(defun org-gfm-footnote-section (info)
@ -277,7 +267,6 @@ INFO is a plist used as a communication channel."
fn-alist
"\n"))))))
;;;; Template
(defun org-gfm-inner-template (contents info)
@ -290,9 +279,6 @@ holding export options."
(toc-tail (if headlines "\n\n" "")))
(org-trim (concat toc-string toc-tail contents "\n" (org-gfm-footnote-section info)))))
;;; Interactive function
@ -323,7 +309,6 @@ non-nil."
(org-export-to-buffer 'gfm "*Org GFM Export*"
async subtreep visible-only nil nil (lambda () (text-mode))))
;;;###autoload
(defun org-gfm-convert-region-to-md ()
"Assume the current region has org-mode syntax, and convert it
@ -333,7 +318,6 @@ a Markdown buffer and use this command to convert it."
(interactive)
(org-export-replace-region-by 'gfm))
;;;###autoload
(defun org-gfm-export-to-markdown (&optional async subtreep visible-only)
"Export current buffer to a Github Flavored Markdown file.