emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Bug: link formating problem [9.0.5 (9.0.5-elpaplus @ /Users/mist


From: Kaushal Modi
Subject: Re: [O] Bug: link formating problem [9.0.5 (9.0.5-elpaplus @ /Users/mistkafka/.emacs.d/elpa/org-plus-contrib-20170210/)]
Date: Wed, 24 May 2017 13:56:04 +0000

On Wed, May 24, 2017 at 9:50 AM Chunyang Xu <address@hidden> wrote:

Nicolas Goaziou writes:

> Hello,
>
> 林镇国 <address@hidden> writes:
>
>> When I insert a link to my note, such as“这是一个[[link][链接]]啦~”,
>> the text after the link, "啦~", will be formatting as link style.
>
> FWIW, I cannot reproduce it, i.e., only "链接" appears with a link face.

I can reproduce if "link" is a real link and "description" doesn't
contain white space, for example,

[[http://example.com/][Example]]blah
                                ^^^^
                                Also under the org-link face

It looks like `org-plain-link-re' doesn't think a link is end unless
a punctuation character is found:

org-plain-link-re
(concat
 "\\<" types-re ":"
 "\\([^ \t\n()<>]+\\(?:([[:word:]0-9_]+)\\|\\([^[:punct:] \t\n]\\|/\\)\\)\\)")
                                              ^^^^^^^^^^^^^^^^^

It is a reasonable assumption for English, but not for Chinese.

I actually stumbled across this few days back, and when using English language :)

Here's a solution that might work for you too (and my notes on why I set this):

;; The default value of `org-highlight-links' contains `plain' too.
;; - "plain" links are links in normal text, no whitespace, like http://foo.com.
;; Here's why I remove "plain" from this list:
;; - If I have two bracketed links next to each-other in org-mode (like below),
;;     [[http://google.com][1]],[[http://orgmode.org][2]]
;; - and, if `plain' is in the `org-highlight-links' list,
;;  the "," in there will also be highlighted as a link. So it would look
;;  as if the "1,2" string pointed to a single link!
;;    But without `plain' as part of this list, the "1" and "2" strings will
;; look like separate links (as should be the case), as the "," will not be
;; highlighted as a link.
(setq org-highlight-links (delete 'plain org-highlight-links))

 
--

Kaushal Modi


reply via email to

[Prev in Thread] Current Thread [Next in Thread]