sytone/obsidian-queryallthethings

Special characters in file name cause broken links

reff opened this issue · 2 comments

reff commented

The following snippet works fine until a note file name contains a special symbol like '

query: |
  SELECT ALL basename
  FROM obsidian_markdown_notes
  LIMIT 20
template: |
  {{#each result}}
  <small>[[{{basename}}]]</small>
  {{/each}}

Special characters cause something like this &#x27; inside the resulting link. Thus, the link becomes broken.

A big deal, one might think. But different languages might require one of those characters.

Wrap basename in three braces like this. {{{basename}}}

This will let handlebars the rending engine know not to html escape the content and trusts that you have already handled any escaping already.

This will cause the single quote to render correctly.

Let me know how it goes.

reff commented

Many thanks for your prompt reply. It works like a charm with the triple-mustache embracement.
And the plugin is really great (my updated dashboard page is now powered by QATT). Thank you