Use John Gruber's regular expression for URL's

http://daringfireball.net/2009/11/liberal_regex_for_matching_urls
This commit is contained in:
Carsten Dominik 2009-12-09 15:13:50 +01:00
parent 3bc637a2a1
commit facedba057
3 changed files with 9 additions and 1 deletions

View File

@ -1,5 +1,10 @@
2009-12-09 Carsten Dominik <carsten.dominik@gmail.com>
* org.el (org-make-link-regexps): Use John Gruber's regexp for
urls.
* org-macs.el (org-re): Interpret :punct: in regexps.
* org-exp.el (org-export-replace-src-segments-and-examples): Also
take the final newline after the END line.

View File

@ -63,6 +63,8 @@ Also, do not record undo information."
(setq ss (replace-match "a-zA-Z0-9" t t ss)))
(while (string-match "\\[:alpha:\\]" ss)
(setq ss (replace-match "a-zA-Z" t t ss)))
(while (string-match "\\[:punct:\\]" ss)
(setq ss (replace-match "\001-@[-`{-~" t t ss)))
ss))
s))

View File

@ -4384,7 +4384,8 @@ This should be called after the variable `org-link-types' has changed."
org-plain-link-re
(concat
"\\<\\(" (mapconcat 'identity org-link-types "\\|") "\\):"
"\\([^]\t\n\r<>() ]+[^]\t\n\r<>,.;() ]\\)")
(org-re "[^ \t\n()<>]+\\(?:([[:word:]0-9]+)\\|\\([^[:punct:] \t\n]\\|/\\)\\)"))
;; "\\([^]\t\n\r<>() ]+[^]\t\n\r<>,.;() ]\\)")
org-bracket-link-regexp
"\\[\\[\\([^][]+\\)\\]\\(\\[\\([^][]+\\)\\]\\)?\\]"
org-bracket-link-analytic-regexp