Make separator between dataview components configurable #2783
Labels
scope: parsing markdown
See also 'scope: global filter'
status: not planned
type: enhancement
New feature or request
🔖 Feature description
You should add a configuration option to automatically add
in front of dataview components.
,
instead of✔️ Solution
The added configuration option should affect the following part of the code.
obsidian-tasks/src/TaskSerializer/DataviewTaskSerializer.ts
Lines 129 to 134 in 48e8250
The default/current behavior could, e.g., be named "Separate by two spaces".
If set to "Separate by comma", above lines should behave like:
❓ Alternatives
You could separate by
,
regardless. Though, I did not consider all the situations where adding a leading comma may be undesirable. Given that #1505 is still open (as of 2024-04-26), I suppose that all dataview fields are at the end of a line. If that is the case, I personally would not mind the initial comma.📝 Additional Context
Such a configuration option would allow the tasks plugin to play more nicely with the "Remove multiple spaces" option of the linter. In particular, when marking a task done from within a
tasks
view, the linter is not run over that file to remove the leading spaces of the added[completion:: today]
. When the user is later editing that file directly, the linter is removing the duplicate space. This introduces unnecessary changes when synchronizing the vault using Git.Furthermore, suppose a user manually added
. For example,
,
in between two dataview components. After editing that task using the "Tasks: Create or edit task" command/GUI, all the,
will be replaced bybecomes
when immediately confirming the GUI dialog. Note the two spaces after the comma. Upon saving, the linter replaces the task by
The text was updated successfully, but these errors were encountered: