8

In an emacs org-mode buffer it is possible to type a hyperlink and then click on the hyperlink with a mouse to open the url in an external browser.

Is there a way for markdown mode to have active hyperlinks as well?

  • Have you seen how to export org-mode doc to markdown? Alternatively, you can use pandoc to export org-mode doc to markdown with a few more customizations (to the links, for example). – Emacs User Sep 15 '16 at 23:35
  • If you have the point on the hyperlink, you can also M-x ffap (short for find file at point) and it opens the default browser with the url at point. (but goto-address-mode is the good answer) – Ehvince Sep 16 '16 at 17:18
3

In the current development version of Markdown mode, links are now clickable without requiring any additional libraries. URLs can also be hidden, and you can hover your mouse pointer to see the URL and optional title text.

  • 1
    More specifically, either ^C ^X ^L or M-x markdown-toggle-url-hiding or add (markdown-toggle-url-hiding t) to your markdown-mode-hook – crimson-egret Jan 17 '18 at 1:22
6

This isn't easy enough to find, but what you want is goto-address-mode. You can activate it in the current buffer with M-x goto-address-mode or you can add it to markdown-mode-hook:

(defun turn-on-goto-address-mode ()
   (goto-address-mode 1))
(add-hook 'markdown-mode-hook #'turn-on-goto-address-mode)
  • Thanks. Two notes from goto-addr.el. 1. Suggested use is (add-hook 'mh-show-mode-hook 'goto-address) 2. If the buffer is fontified after goto-address-fontify is run (say, using font-lock-fontify-buffer), then font-lock faces will override goto-address faces. – Kevin Wright Sep 16 '16 at 13:43
  • Ah! Good to know. – amitp Sep 16 '16 at 19:55
-1

In an emacs org-mode buffer it is possible to type a hyperlink and then click on the hyperlink with a mouse to open the url in an external browser.

Yes this can be done without any additional code.

The format in which you have enter URLs in org-mode file is [[http://www.google.co.in][Google India]]. This will open the webpage (in your default browser) on a click event.

This is how it looks in my org file
Hyperlink in org-mode
Manual reference

  • The question is about markdown mode, not about exports. – amitp Sep 16 '16 at 19:56
  • You're right. I answered the first part of the question right. I misunderstood the second part. Edited my answer to remove the markdown portion – Prasanna Sep 17 '16 at 0:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.