Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't print multiples lines in dynamic commands #1321

Open
1 task
sineptic opened this issue Feb 11, 2024 · 5 comments
Open
1 task

Can't print multiples lines in dynamic commands #1321

sineptic opened this issue Feb 11, 2024 · 5 comments
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@sineptic
Copy link

Plugin information (please complete the following information):

  • OS: Arch Linux
  • Templater version: 2.1.4
  • Obsidian version: 1.5.3
  • Templater settings: default

Describe the bug
in all dynamic templates(<%+ ... %>) no new lines added. As I can see it replaced to white spaces.

Example
dynamic:
__ <- not printed, it's for you
<%+ "hello \n \n something" %>
__
hello something
__

but static:
__
<% "hello \n \n something" %>
__
hello

something
__

Expected behavior
new line as new line

Screenshots
edit_mode_before_repalce_templates
preview_mode_before_replace_templates
edit_mode_after_replace_templates

Additional context
I need to use it for displaying my tasks in kanban(plugin). It's require tasks in markdown format, but templater don't add new line and I have this:

  • Sit placeat unde minus quo - [ ] molestias cupiditate repellat - [ ] Porro sunt quis error vel - [ ] Aut assumenda facere - [ ] Nihil non eligendi sed
@sineptic sineptic added the bug Something isn't working label Feb 11, 2024
@sineptic sineptic changed the title Can't print multiples lines in dynamic templates Can't print multiples lines Feb 11, 2024
@Zachatoo
Copy link
Collaborator

Dynamic commands is a feature that I won't be working on anymore (see #913).

If you really need it to be dynamic, please use Dataview instead.

@Zachatoo Zachatoo added the wontfix This will not be worked on label Feb 11, 2024
@Zachatoo Zachatoo changed the title Can't print multiples lines Can't print multiples lines in dynamic commands Feb 11, 2024
@sineptic
Copy link
Author

If you really need it to be dynamic, please use Dataview instead.

I can't do this, because dataview only render text, but templater insert text to note. It's required to use result after (render using kanban). 'Tasks' plugin don't work too(only render).

I don't find alternatives for using markdownTaskList(from dataview; returns plain text) in dynamic templater.

@sineptic
Copy link
Author

I think it's easy to fix, but i don't know javascript(but know other laguages). If you say where dynamic commands render(in code), I try to fix it myself.

@Zachatoo
Copy link
Collaborator

Dynamic commands do not insert text into a note, but if you say they seem to for your needs then I believe it.

Just search for dynamic in the codebase and you'll find where it's at, there might be a few places. I'm not very familiar with that code, I ignore it. If you fix it and it doesn't cause issues with non-dynamic commands then I'll happily merge it!

@sineptic
Copy link
Author

sineptic commented Feb 18, 2024

I think it's not that repository issue. Mb bug in https://github.com/SilentVoid13/rusty_engine (created for this project). Bug may contains in Parser::parse_whitespace in first argument "i", that's whitespace chars. I can't fix it because all in one file and names are one letter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants