~bzg/org-sync

00fcdc750f0ad642f9c5c542880ba93c78ec4203 — Adam Awan 8 years ago dab3323
Only regexp-replace newlines in description if it is non-nil
1 files changed, 5 insertions(+), 3 deletions(-)

M os-github.el
M os-github.el => os-github.el +5 -3
@@ 220,9 220,11 @@ Return the server decoded JSON response."
;; XXX: we need an actual markdown parser here...
(defun os-github-filter-desc (desc)
  "Return a filtered description of a GitHub description."
  (setq desc (replace-regexp-in-string "\r\n" "\n" desc))
  (setq desc (replace-regexp-in-string "\\([^ \t\n]\\)[ \t\n]*\\'"
                                       "\\1\n" desc)))          
  (if desc (progn
             (setq desc (replace-regexp-in-string "\r\n" "\n" desc))
             (setq desc (replace-regexp-in-string "\\([^ \t\n]\\)[ \t\n]*\\'"
                                                  "\\1\n" desc)))))


(defun os-github-json-to-bug (data)
  "Return DATA (in json) converted to a bug."