Because you are using $note$ syntax, I assume your code is contained within a \define somemacro(note)... definition. If so, then you can completely avoid the use of the tripled doublequotes around “”"$note$"""" and instead use <<__note__>> to refer to the parameter value, like this:
Also, since you are just rendering the resulting notetext, you might be able to completely omit the $wikify widget, and just output $note$ directly, since it will be automatically rendered when the macro output is rendered.
This is not really an answer to your question. But my workaround — throughout my academic wikis, which require quote-marks quite often! — is to make all my actual content use curly-quotes and real apostrophes “” ‘’, so that only my code uses prime and double-prime marks ' " (my snooty typography name for the simpler version of quote marks and apostrophes as the keyboard usually creates them).
Curly marks do look nicer and carry more info! But this commitment does generate a nuisance whenever I’m pulling in content from other sources.
In this case you are using triple double quotes, I tend to call these “quotes” in contrast to single Quotes. So I may have said triple quotes.
In many ways all you need to know is what may be inside the quotes and use that which is not. If you wanted the following “quoted” "$note$" you can use '"$note$"'
'
"
"""
See here Literal Attribute Values which explains the three methods above. However if the value is delimited by any other means the quote(s) may not be needed at all, eg <<>> the one @EricShulman shared <<__ __>>, {{ }} etc…
My point is if your content/value contains " use ', if it contains ' use ", and if it contains both, in some case you can use """ if you can separate it from ".
Thanks. In many cases the content is unknown, so I need support all cases, which means I cannot use any type is quote. Many languages have a way of escaping characters.
The devil is in the detail of course however you should be able to have your strings referenced in a way that avoids the need to use any type of quote by “leaning” on tiddlywikis own delimiters. Although do your strings contain tripple quotes?
Feel free to share some examples of problematic strings. I am confident tiddlywiki has sufficiant delimiters that we can handle most if not all posible cases.
@EricShulman suggested I use (which I did implement):
<<__note__>>
Whatever is used here it needs to support any characters the user could type in the postnote field. Does the above approach do this, or are there characters that could cause an issue?
If you are passing in a macro parameter that comes from USER input, assume that it can contain ANY combination of characters (including single, double, or tripled-double quotes). This is because users can type in those quote characters, even if they wouldn’t really make any sense for the intended use-case.
In addition to the """$param$""" case, you should also be careful when using filteroperator[$param$] within filter syntax, because a user could enter an errant [ or ] in their input, which would then break the filter syntax.
For \define macros, you can generally avoid both of these situations by using <<__param__>> (or <__param__> in filters). For \procedure “macros”, you can use <<param>> (or <param> in filters) to accomplish the same thing.
…and, for use-cases where you need to construct a text value with added literal text as prefix or suffix, you can even do something like the following to avoid using ANY kind of quotes or square brackets to set a variable: