I have a problem when I want to yas-expand a link in Org-mode
and it has a dash (-) in the text (url and description). Then the snippet break and exits. If I do the same in fundamental-mode
it works.
Example
Typing text in fundamental and Org-mode. In fundamental mode:
"jira<tab>abc-123" ->
[[https://jira.example.com/browse/ABC-123][ABC-123]]
In Org-mode:
"jira<tab>abc-123" ->
[[https://jira.example.com/browse/ABC-][ABC-]]123
In fundamental-mode I can tab to the last position. But in Org-mode it exits before that.
Snippet
The snippet looks like this:
# -*- mode: snippet -*-
# name: jira
# key: jira
# --
[[https://jira.example.com/browse/${1:$$(upcase yas-text)}][$1]]$0
Emacs Config
I have this config:
(use-package yasnippet
:ensure t
:config (yas-global-mode))
Full source for this (my emacs testing area): Source
If I change the snippet and remove the last "]", it works again but without becoming a link.
From: [[${1:$$(upcase yas-text)}][$1]]$0
To: [[${1:$$(upcase yas-text)}][$1]$0
So it has something todo with org-insert-link
but I cannot find out if this belongs to yas or org. Maybe there is a workaround for this. Any ideas how to troubleshoot or fix this?
Versions
yasnippet-20181015.1212
Org mode version 9.1.9 (release_9.1.9-65-g5e4542 @ /usr/share/emacs/27.0.50/lisp/org/)
GNU Emacs 27.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2019-03-04