Open Jermolene opened 1 year ago
See #6317 which also requests consistency in applying square brackets.
Dpeneding on how we address this, there might be backwards compatibility implications for use of the draggable widget.
I think that's an issue now since we disabled automatic wiki-links for new wikis. ...
I personally do like this default behaviour and we should not change it. I use the drag from Open sidebar mainly to drag tiddler titles into tag-like fields. For tags we need [[New Tiddler]] but we do not need [[HelloThere]]
I think that's the way how it was initially intended to work.
Instead I do propose that we add modifier-keys eg: SHIFT, CTRL and ALT to create different type of links. So it would be possible eg:
and so on
I did some more testing. For tags, it does not matter if HelloThere has braces or not. The tag field removes them.
For standard fields, we need to have a closer look what filter operators like enlist
or enlist-input
return if they are fed with [[HelloThere]] instead of HelloThere as it is now. I don't know that atm
Hi @pmario the current behaviour is nothing to do with automatic wikilinks; it's the function "stringifyList()" (referenced in the OP) that adds the double square brackets purely according to whether the title contains whitespace.
The idea of using modifier keys is not universal because it won't work on touch devices.
I think this issue is also related to: [IDEA] Option to make drag and dropping tiddler titles (shown as a link) always make a link #6317
which mentions: [IDEA] In editor, drop image-link to create an external link #5309
As I wrote in #6317, the title string that is dropped into a text-area is created at the drag-start which is line: https://github.com/Jermolene/TiddlyWiki5/blob/23b5b7f7d9abafcec4e357b154319ee7ab187704/core/modules/utils/dom/dragndrop.js#L49
And it's the dataTransfer object text/plain
text that is passed to the text-input for import.
For very fine grained control for desktop and mobile
It may be possible to set a tv-dnd-start="titlelist"
variable, which imo would be in line with the format:titlelist operator suffix.
For mobile and desktop
The utility.makedraggable()
function could read the tv-dnd-*
variables and act according to their value. eg:
tv-dnd-start="titlelist"
... Creates a titlelist for every tiddler title that is dragged & dropped into a text-area
Possible tv-dnd- variables
{{abc}}
instead of [[abc]]
{{||abc}}
<you-name-it>
" ..For desktop
tv-dnd-*
settings. utility.makedraggable()
... DnD-dragend may have similar possibilities with tv-dnd-end-<you-name-it>
Hi @pmario rather than supporting a fixed list of transformations such as title, transclusion, templatelist etc. we could instead have a configuration variable that contains a function that is executed to convert the title of a tiddler at the point that it is dragged into the text that the receiving application sees. For example:
\function tv-dnd-incoming-title-transformation(title) [<title>addprefix[{{]addsuffix[}}]]
Describe the bug
Dragging a title link of a tiddler with a space in the title into a text area will create a link to that tiddler by wrapping the title in double square brackets. However, dragging a title link of a tiddler that does not have a space in the title into a text area will not wrap the title in double square brackets and thus will not create a link.
This behaviour occurs because of the use of
$tw.utils.stringifyList()
in dragndrop.js:https://github.com/Jermolene/TiddlyWiki5/blob/23b5b7f7d9abafcec4e357b154319ee7ab187704/core/modules/utils/dom/dragndrop.js#L128
Expected behavior
The expected behaviour is that dragging a tiddler title into a text area will always wrap each title in double square brackets to make it act as a link.
There is a thread on talk.tiddlywiki.org where a user requests the option to wrap dragged titles in double braces (for transclusion) instead of double square brackets, and that seems a reasonable option to support
To Reproduce
Screenshots
No response
TiddlyWiki Configuration
TiddlyWiki v5.2.7
Additional context
No response