How to escape the back-tick (`) character in tiddlywiki? - tiddlywiki

I would like to use the back-tick in regular text (not in a code snippet) in TW5. Is this possible?

It is also possible to use the hex code (`) or the HTML code (&#96) for back-tick
I wanted to display a back-tick in a code block, so used:
<code>`</code>
Using the HTML code looks like:
<code>`</code>
This has the advantage that you're not disabling any parsing rules.

In TiddlyWiki5 you can disable certain parsing rules using the \rules pragma
A pragma is a special component of WikiText that provides control over the way the remaining text is parsed.
http://tiddlywiki.com/#Pragma
So if you add
\rules except codeinline
at the very(!) beginning of your tiddler text, any following backtick symbol in the text is not interpreted as special character.
This comes however at the cost that you cannot use this symbol as wikitext-directive anymore to achieve inline-code for programming snippets. Instead you would need to add the html code tag manually.

Related

How to use asterisk emoji with Sphinx and without warnings?

If I use an asterisk emoji character in my documentation (*️⃣) then Sphinx will complain with a warning:
WARNING: Inline emphasis start-string without end-string.
That is because it is interpreting the character as a separate asterisk plus something else.
How could avoid that warning?
I am trying to avoid having to use literal/:samp:, since they add a grey background to the character in the HTML output.
You can escape any reserved reStructuredText markup character with a backslash:
\*️⃣

Escape single quote in Xtend template expression

I have a very simple question, but could not figure it out by Google search, please help.
I want to produce this string '\u0000' (note the simple quote marks surrounding it!) using the following simple Xtend method containing a template expression:
def String makeDefaultChar()
{
''''\u0000''''
}
However, this is not accepted as proper syntax (probably because of the four ''''. Is there an escape character for this use case or what is the right syntax?
Thank you in advance!
P.S.
Of course I could use plain Java string like this "'\\u0000'" to achieve the same, but I want to use an Xtend template expression.
My Xtend version is: 2.9.1.v201512180746
There is no "escaping" in template expressions, so you have to use the workaround you mentioned:
'''«"'\\u0000'"»'''
or
'''«"'"»\u0000«"'"»'''
Related discussion: https://groups.google.com/forum/#!topic/xtend-lang/bVZ0nKmQGAI
Single quotes are allowed within Xtend templates as long as they do not occur at the beginning or the end of the template. So a simple workaround is to add an empty expression before/after the single quote:
'''«»'\u0000'«»'''

Custom code highlight Notepad++

I am creating a custom code highlight for notepad++. What I want to do is the following:
some fieldnames are writen in the code with a ' in front of their name, for exampe
if 'variable = "test" then ...
I would like to highlight these words, but notepad++ does not seem to allow a delimiter starting with ' and ending with a space, not does it allow space as an escape character. Also, using ' as a keyword and enabling prefix mode has no effect. Anyone has a suggestion? Should I use another expression to let notepad recognise the space/' ?
Thanks in advance!
If you only need to highlight a single word, you can use a keyword in prefix mode. However when using single or double quotes in a keyword, they need to be escaped with a backslash. So your keyword would be:
\'
This may not be possible in notepad++. I can get the behavior you want using a character other than a single quote, like a back-tic, but it doesn't seem to work with single or double quotes. I suspect those characters are treated special within the syntax highlighter.

Error while rendering '&' in telerik html textbox

How can I handle an ampersand ("&") character in a Telerik HTML textbox?
While rendering, it's giving me an error. Also, does anybody know about any other character that may cause errors in an HTML textbox?
Ampersand is a special character in HTML that specifies the start of an escape sequence (so you can do something like © to get a copyright symbol, etc.). If you want to display an ampersand you have to escape it. So if you replace all ampersands with &, that should take care of the error.
However, if there were ampersands in your input that were already escaped - like maybe your data had © - you wouldn't want to escape that ampersand. But if your data won't have any of these ampersands, a simple replace should be fine.
You also need to replace greater than and less than symbols (> and <) with > and < respectively.
Telerik talks about these limitations/issues on this page http://www.telerik.com/help/reporting/report-items-html-text-box.html
Also according to the HTML specification (and the general XML
specification as well) the "&", "<" and ">" characters are considered
special (markup delimiters), so they need to be encoded in order to be
treated as regular text. For example the "&" character can be escaped
with the "&" entity. More information on the subject you can find in
this w3.org article.

Freemarker escaping freemarker

I'm using freemarker to generate a freemarker template. But I need some way to escape freemarker tags.
How would I escape a <#list> tag or a ${expression} ?
You could also use: ${"$"}{expression} if you find the {} nesting confusing.
I'm using the alternative syntax feature. I start the template with [#ftl] and use this syntax.
For the expressions I use the string literal feature: ${r"${expression}"}
You can configure FreeMarker to use [=exp] instead of ${exp} (since 2.3.28), and [#...]/[#...] instead of <#...>|<#...> by setting both the interpolation_syntax and the tag_syntax configuration setting to square_bracket (in the Java API: Configuration cfg; ... cfg.setInterpolationSyntax(Configuration.SQUARE_BRACKET_INTERPOLATION_SYNTAX) and cfg.setTagSyntax(Configuration.SQUARE_BRACKET_TAG_SYNTAX)). Then the syntax doesn't clash with the default syntax.
There's one tricky case; if the template starts with <#ftl>, then it will switch the tag syntax back to angle_bracket. To counter that, just add a [#ftl] line before it.
See also: https://freemarker.apache.org/docs/dgui_misc_alternativesyntax.html
In the case when you want to use non-raw strings so that you can escape double quotes, apostrophes, etc, you can do the following:
Imagine that you want to use the string ${Hello}-"My friend's friend" inside of a string. You cannot do that with raw strings. What I have used that works is:
${"\x0024{Hello}-\"My friend's friend\""}
I have not escaped the apostrophe since I used double quotes.

Resources