Fix bug when pasting Markdown-formatted text

Now Markdown ain't no smushed anymore.

Also, the `edit-indirect` allows me to edit source code in a Markdown
file just like org.
This commit is contained in:
Howard Abrams 2026-09-17 17:04:56 -07:00
parent c40d7f4856
commit aaf9533c56
2 changed files with 7 additions and 1 deletions

View file

@ -145,7 +145,7 @@ Let's define the clipboard for a Mac. The challenge here is that we need to bina
(shell-command-with-exit-code "osascript" "-e" "the clipboard as \"HTML\"")
(if (= 0 exit-code)
(list :html (ha-convert-applescript-to-html contents))
(list :text (shell-command-to-string "osascript -e 'the clipboard'")))))
(list :text (string-replace "\r" "\n" (shell-command-to-string "osascript -e 'the clipboard'"))))))
(defun ha-convert-applescript-to-html (packed-contents)
"Applescript's clipboard returns the contents in a packed array.

View file

@ -1125,6 +1125,12 @@ Also, I like Markdown to look like a word processor, similarly to my org files:
Note that the markdown-specific commands use the ~C-c C-c~ and ~C-c C-s~ prefixes.
The [[https://github.com/Fanael/edit-indirect/blob/master/edit-indirect.el][edit-indirect]] code allows me to edit triple-backtick code in a separate buffer.
#+BEGIN_SRC emacs-lisp
(use-package edit-indirect)
#+END_SRC
*** Rendering with Pandoc
We call both the =markdown-command= and the =markdown-open-command= variables to render (and preview) a Markdown file (~C-c C-c o~), and calls the following scripts (which in turn, call =pandoc= as I depend on this for other org-related features):