[TW5] How dow I escape < and > characters

1,466 views
Skip to first unread message

Branimir Braykov

unread,
Feb 4, 2015, 9:31:15 AM2/4/15
to tiddl...@googlegroups.com
Hi, All,
< and > are not actually wiki characters, but whenever I want to write text like this: "some <of my> text" I get "some text" rendered.
Is this a bug? If its not, then I cannot find anything about special usage of < > (except <$.... >) in the documentation.

P.S.
Please, don't suggest to use html entities. I know about it, but I want to find a general solution.

Jed Carty

unread,
Feb 4, 2015, 10:02:24 AM2/4/15
to tiddl...@googlegroups.com
< and > are being treated as part of an html tag. If you have a space after the leading < it should display normally. You say not to tell you to use html escape characters, but it is the html doing it. Your other option is to make macros like this

\define lt() <$text text='<'/>

\define gt() <$text text='>'/>

And put them in a tiddler tagged $:/tags/Macro
Then wherever you put <<lt>> or <<gt>> it will display < or >

Branimir Braykov

unread,
Feb 4, 2015, 10:14:37 AM2/4/15
to tiddl...@googlegroups.com
10x,
what I didn't think of is exactly that this is html and treated for html tags.
The solution that is best for me is using the space after it.
However, it is still strange, because in TWC this works as it is.

Stephan Hradek

unread,
Feb 4, 2015, 10:25:15 AM2/4/15
to


Am Mittwoch, 4. Februar 2015 15:31:15 UTC+1 schrieb Branimir Braykov:
P.S.
Please, don't suggest to use html entities. I know about it, but I want to find a general solution.

If you prefer a general solution instead of the entities &lt; &gt;, you can use &#60; and &#62;
 

Tobias Beer

unread,
Feb 4, 2015, 11:51:55 AM2/4/15
to tiddl...@googlegroups.com
Please, don't suggest to use html entities. I know about it, but I want to find a general solution.
If you prefer a general solution instead of the entities &lt; &gt;, you can use &#60; and &#62;

Is there actually a d difference about numbered or textual entities?
To me, both are equally "general" only that the textual ones are a little more recognizable.

Best wishes, Tobias.

Eric Shulman

unread,
Feb 4, 2015, 1:53:34 PM2/4/15
to tiddl...@googlegroups.com
On Wednesday, February 4, 2015 at 7:14:37 AM UTC-8, Branimir Braykov wrote:
10x,
what I didn't think of is exactly that this is html and treated for html tags.
The solution that is best for me is using the space after it.
However, it is still strange, because in TWC this works as it is.

TW5 allows mixing of HTML syntax with wiki syntax, so any character sequences enclosed in angle brackets are treated as HTML.  In contrast, TWC only allows HTML syntax when it is enclosed within <html>...</html>.  Thus, if angle brackets occur *outside* the <html> block, the are treated as regular characters.

Note: The TWC core <html> handler only supports "pure" HTML syntax (i.e., you can't use wiki syntax).
To mix wiki syntax within a TWC <html> block, you need http://www.TiddlyTools.com/#HTMLFormattingPlugin

-e

Stephan Hradek

unread,
Feb 4, 2015, 2:29:05 PM2/4/15
to tiddl...@googlegroups.com


Am Mittwoch, 4. Februar 2015 17:51:55 UTC+1 schrieb Tobias Beer:
Please, don't suggest to use html entities. I know about it, but I want to find a general solution.

If you prefer a general solution instead of the entities &lt; &gt;, you can use &#60; and &#62;

Is there actually a d difference about numbered or textual entities?
Of course there is. The later one are entities and are defined: http://www.w3.org/TR/html4/sgml/entities.html

The numbers are not entities but "Numeric character references". Branimir was explicitly asking for a more general solution than "entities". Character references are the most general ones I can think of.

Bob Robison

unread,
Feb 7, 2015, 10:18:51 AM2/7/15
to tiddl...@googlegroups.com
And I guess it is a fair assumption that there is no generic way to 'escape' any character that might otherwise be interpreted by the parser?  i.e. I ran into a problem recently where I really needed to have two forward slashes next to each other in some text (//).  However I could never get it to render properly, as I assume it was trying to make something italics..

I would think it would be useful if there were *some* mechanism that could mean interpret the next character exactly.

bob

Jeremy Ruston

unread,
Feb 7, 2015, 11:20:28 AM2/7/15
to TiddlyWiki
Hi Bob

> I would think it would be useful if there were *some* mechanism that could mean interpret the next character exactly.

I agree. One option that's been discussed in the past is check for a preceding ~ before every parse rule, and suppress it if it is found. I think it may be more flexible to be able to suppress all wikitext processing in a passage, without having to find and suppress each rule. For example, ===this is //not// italicised===.

I've created a ticket for the latter idea:


Best wishes

Jeremy.



--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.



--
Jeremy Ruston
mailto:jeremy...@gmail.com

PMario

unread,
Feb 7, 2015, 5:45:28 PM2/7/15
to tiddl...@googlegroups.com
One option to disable "italic" rendering is with the \rules pragma.

eg: If you include this into a tiddler the // will not be rendered.

\rules except italic

-mario

sini-Kit

unread,
Feb 8, 2015, 2:19:43 PM2/8/15
to tiddl...@googlegroups.com
 &lt;  and &gt; 



среда, 4 февраля 2015 г., 17:31:15 UTC+3 пользователь Branimir Braykov написал:

Branimir Braykov

unread,
Feb 9, 2015, 6:18:28 AM2/9/15
to tiddl...@googlegroups.com
And until suppressed parsing is invented, I just wanted to add that > does not have to be escaped if < is escaped.
So only &lt;some text> is enough :-)

Stephan Hradek

unread,
Feb 9, 2015, 7:11:18 AM2/9/15
to tiddl...@googlegroups.com


Am Montag, 9. Februar 2015 12:18:28 UTC+1 schrieb Branimir Braykov:
And until suppressed parsing is invented, I just wanted to add that > does not have to be escaped if < is escaped.
So only &lt;some text> is enough :-)

Are you sure?

\define showme(txt) $txt$

# <<showme "test&gt;&gt;">> - correct
# <<showme "test>>">> - wrong

 

Branimir Braykov

unread,
Feb 9, 2015, 8:34:45 AM2/9/15
to tiddl...@googlegroups.com
OK, in your case, I'm not :-)
Reply all
Reply to author
Forward
0 new messages