Item10242: Exclamation mark does not work the same as the HTML nop when parenthesis are involved.
Priority: Normal
Current State: Closed
Released In: 2.0.0
Target Release: major
One of the ways to escape a macro is to prepend it with a bang (
!
).
Normally this works fine, e.g.
However, if I want to put the same text in parenthesis, the bang fails to escape the macro, e.g.
* (!%SYSTEMWEB%)
Since nop tags can be used to accomplish the same, marking this low priority.
--
WryFi - 11 Jan 2011
raising to normal - as it shows that the renderer/parser is being inconsistent.
we should convert all the synonyms for NOP to one form right at the beginning, and thus deal with them identically.
--
SvenDowideit - 09 Mar 2011
The ! Normally escapes wikiwords. I did not we had a spec that made it escape the expansion of a macro. Where is that documented and is it correct?
--
KennethLavrsen - 09 Mar 2011
This function has been in the code since original import.
commit cd9c3f9d90142efd713de5addc2c35afd83aac96
Author: CrawfordCurrie <CrawfordCurrie@0b4bb1d4-4e5a-0410-9cc4-b2b747904278>
Date: Wed Nov 19 13:40:25 2008 +0000
Item175: First bulk rename pass. Note: not quite ready yet
git-svn-id: http://svn.foswiki.org/trunk@809 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
diff --git a/core/lib/Foswiki.pm b/core/lib/Foswiki.pm
--- /dev/null
+++ b/core/lib/Foswiki.pm
@@ -0,0 +2789,2 @@
+ # Escape ' !%VARIABLE%'
+ $$text =~ s/(?<=\s)!%($regex{tagNameRegex})/%$1/g;
So if anything we need to document it, not remove it. The regex could use some tweaking as well to be a bit more generous in what it escapes. Any non-space character in front of the ! disables the escaping. Another option is to deprecate use of ! to escape macros, and document that
%<nop%gt;MACRO%
is the recommended solution.
-
%SYSTEMWEB%.!%TOPIC%
becomes: System.%TOPIC%
- =!%SYSTEMWEB%= becomes:
!System
--
GeorgeClark - 04 Jan 2015