Macros only render if a space precedes them.
Languages such as Chinese or Japanese do not use spaces, thus making it impossible to use macros.
foo {{macro}}bar ← renders
foo{{macro}}bar ← does not render
青い{{macro}}です。 ← does not render
Macros only render if a space precedes them.
Languages such as Chinese or Japanese do not use spaces, thus making it impossible to use macros.
foo {{macro}}bar ← renders
foo{{macro}}bar ← does not render
青い{{macro}}です。 ← does not render
Consider passing the surrounding text as parameter, either:
:macro "$1何か"
{{macro 青い}}です。
:macro "$1何か$2"
{{macro 青い, です。}}
Thanks for the reply.
Unfortunately, that approach does not really solve the problem.
For example if I have:
:macros {
"ruby" "<ruby>$1<rt>$2</rt></ruby>"
}
Then, if I write “これは{{ruby 青, あお}}い何かです。” the macro does not get parsed by Logseq and will simply render as it is, i.e. “これは{{ruby 青, あお}}い何かです。”.
But if I write “これは {{ruby 青, あお}}い何かです。” (note the space before the opening curly bracket) then it will render as “これは 青い何かです。”.
Similarly, in English, if I have
:macros {
"cite" "<cite class='$1'>$2</cite>"
}
And have a block like ‘For details see “{{cite paper, Article Title}}” in Awesome Journal.’ It will not render unless I insert a space character between the opening quote and opening curly bracket.
Thanks in advance
The problem is real.
Hopefully, the Logseq team will eventually solve the problem at its core.
For the time being, here is the workaround I came up with:
.macro {
margin-left: calc(-5em / 18);
}
I just noticed that block references run into the exact same problem, i.e. the opening double bracket requires a space.