You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
String being escaped in Template export using docker latest
Is there an existing issue for this?
I have searched the existing issues
Can the issue be reproduced with the default theme (daylight/midnight)?
I was able to reproduce the issue with the default theme
Could the issue be due to extensions?
I've ruled out the possibility that the extension is causing the problem.
Describe the problem
I have exported a template with an action, the action is .action{now | date "2006-01-02 15:04:05"} when I attempt to load the template it complains of Parse template failed: template: :1: unexpected "&" in operand v2.10.14
See below for the template, this was generated using the export function
<span data-type="code">.action{now | date "2006-01-02 15:04:05"}</span>
{: id="20231114103309-onlbj9t"}
Serial Number:
{: id="20231114103421-ivxd941"}
RO:
{: id="20231114103450-x05fd0t"}
I can confirm that manually replacing the " with " fixes the template
Expected result
I was expecting the date to be shown in the output of a new document.
Doesn't look to have been updated in a while... Nor does ithave a reference to the issue
I 2023/11/14 18:16:25 index.go:206: resolved refs [33] in [52ms]
I 2023/11/14 18:28:00 index.go:133: rebuilt database for notebook [20231114182759-iltp2z6] in [0.00s], tree [count=0, size=0 B]
I 2023/11/14 18:28:00 index.go:206: resolved refs [4] in [4ms]
W 2023/11/14 18:32:30 transaction.go:920: not found block [20231114103207-y5h9ngr]
W 2023/11/14 18:32:30 transaction.go:920: not found block [20231114103207-y5h9ngr]
W 2023/11/14 18:32:32 transaction.go:920: not found block [20231114103207-y5h9ngr]
W 2023/11/14 18:32:34 transaction.go:920: not found block [20231114103207-y5h9ngr]
I 2023/11/14 18:33:20 index.go:133: rebuilt database for notebook [20210808180117-6v0mkxr] in [0.04s], tree [count=61, size=1.1 MB]
I 2023/11/14 18:33:21 index.go:206: resolved refs [33] in [49ms]
E 2023/11/14 18:38:14 widget.go:63: get bazaar package [https://oss.b3logfile.com/package/muhanstudio/siyuan-widget-Color-Calendar@3618012d665a257c9c4b1c8ea54e30392ad01c8c/widget.json] failed: 404
More information
No response
The text was updated successfully, but these errors were encountered:
Hello, this problem is because the content in the inline code nodes is parsed when the template is rendered. The correct implementation is to only parse the content of the text nodes. Thanks for the feedback.
After evaluating the implementation, if we only use text nodes as templates, there may be potential problems (such as losing context). We may only consider using built-in placeholder encoding to replace the code node content before rendering, and then replace it after the template rendering is completed.
88250
changed the title
Actions in templates are only parsed from text nodes
Ignore .action in code nodes when rendering templates
Nov 14, 2023
I still didn't think well about the above...ignoring code nodes will change the semantics. It seems that the escaping problem should be dealt with, thank you.
String being escaped in Template export using docker latest
Is there an existing issue for this?
Can the issue be reproduced with the default theme (daylight/midnight)?
Could the issue be due to extensions?
Describe the problem
I have exported a template with an action, the action is
.action{now | date "2006-01-02 15:04:05"}
when I attempt to load the template it complains ofParse template failed: template: :1: unexpected "&" in operand v2.10.14
See below for the template, this was generated using the export function
I can confirm that manually replacing the
"
with"
fixes the templateExpected result
I was expecting the date to be shown in the output of a new document.
Screenshot or screen recording presentation
2023-11-14.11-17-49.mp4
Version environment
Log file
Doesn't look to have been updated in a while... Nor does ithave a reference to the issue
I 2023/11/14 18:16:25 index.go:206: resolved refs [33] in [52ms]
I 2023/11/14 18:28:00 index.go:133: rebuilt database for notebook [20231114182759-iltp2z6] in [0.00s], tree [count=0, size=0 B]
I 2023/11/14 18:28:00 index.go:206: resolved refs [4] in [4ms]
W 2023/11/14 18:32:30 transaction.go:920: not found block [20231114103207-y5h9ngr]
W 2023/11/14 18:32:30 transaction.go:920: not found block [20231114103207-y5h9ngr]
W 2023/11/14 18:32:32 transaction.go:920: not found block [20231114103207-y5h9ngr]
W 2023/11/14 18:32:34 transaction.go:920: not found block [20231114103207-y5h9ngr]
I 2023/11/14 18:33:20 index.go:133: rebuilt database for notebook [20210808180117-6v0mkxr] in [0.04s], tree [count=61, size=1.1 MB]
I 2023/11/14 18:33:21 index.go:206: resolved refs [33] in [49ms]
E 2023/11/14 18:38:14 widget.go:63: get bazaar package [https://oss.b3logfile.com/package/muhanstudio/siyuan-widget-Color-Calendar@3618012d665a257c9c4b1c8ea54e30392ad01c8c/widget.json] failed: 404
More information
No response
The text was updated successfully, but these errors were encountered: