Edgewall Software
Modify

Opened 20 years ago

Closed 15 years ago

Last modified 7 years ago

#616 closed defect (fixed)

escape character in the wiki

Reported by: toni Owned by: Remy Blank
Priority: normal Milestone: 0.12
Component: wiki system Version: 0.7.1
Severity: normal Keywords: escape link
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

From what I understand there is no escape character in the wiki. This is a problem when you try to write things that are tags. It would be nice if the equvalent of the backslash in unix existed.

That is if there is a backslash next char is interpreted as normal character.

Attachments (0)

Change History (25)

comment:1 by daniel, 20 years ago

Milestone: 0.8

comment:2 by daniel, 20 years ago

Severity: normalmajor

You can escape a WikiLink by preceding it with a single '!'.

Example:

!WikiLink

Results in:

WikiLink

However, this doesn't work for all hyperlinks.

Possibly, it should also work to escape anything:

 * ![wiki:SomePage this could be escaped]
 * ![file:/trunk/README this could also be escaped]
 * !browser:/trunk/trac/
 * !http://www.edgewall.com/
 * !http://projects.edgewall.com/trac_common/edgewall_logo_left-226x43.png

Results:

  • [wiki:SomePage this could be escaped]
  • [file:/trunk/README this could also be escaped]
  • browser:/trunk/trac/
  • http://www.edgewall.com/
  • http://projects.edgewall.com/trac_common/edgewall_logo_left-226x43.png

comment:3 by daniel, 20 years ago

Keywords: escape link added

comment:4 by daniel, 20 years ago

Some more examples:

 * !#42
 * ![42]
 * !{42}

Results:

  • #42
  • [42]
  • {42}

comment:5 by daniel, 20 years ago

Owner: changed from Jonas Borgström to daniel
Status: newassigned

comment:6 by daniel, 20 years ago

Resolution: fixed
Status: assignedclosed

Fixed in [824].

comment:7 by anonymous, 15 years ago

Resolution: fixed
Status: closedreopened
This escape character works fine for links - but there needs to be a way to escape other characters, such as the double pipes '
' as in required my case.

comment:8 by Christian Boos, 15 years ago

Milestone: 0.80.12
Severity: majornormal

Well, right, double pipes are not yet escapable with !, and this can be considered as a bug, I guess.

You can use `||` in the meantime.

comment:9 by sheepdean, 15 years ago

Is there any way to create a page with square brackets in the title? Unicode and the native symbols are rejected, but I need to make an article with them in.

in reply to:  9 comment:10 by Christian Boos, 15 years ago

Replying to sheepdean:

Is there any way to create a page with square brackets in the title?

==== [and what's the problem, exactly?] ====

[and what's the problem, exactly?]


it seems to work… if I misunderstood something, please provide a more precise example.

In case you were talking about wiki page names, that should work as well: [wiki:"[head]" the head] - the head

What won't work is ] in the label of a link - maybe that was what you were referring to. In any case, please try to be more precise.

comment:11 by Remy Blank, 15 years ago

Resolution: fixed
Status: reopenedclosed

Double pipes can now be escaped (fixed in [8679]).

comment:12 by Remy Blank, 14 years ago

Owner: changed from daniel to Remy Blank

comment:13 by anonymous, 14 years ago

About square brackets…

How should I write this:

Parameter value: "local:[/optional/path/to]"

If I put the exclamation mark before the opening square bracket, trac shows me this escaping symbol:

  • Parameter value: "local:![/optional/path/to]"

comment:14 by Christian Boos, 14 years ago

![/optional/path/to] gives [/optional/path/to], which is OK, but in your example, the local: prefix is making things more complex… while the exact reason this fails can certainly be traced to the details of the regexps (shref), let's just say that anyway at this level we're dealing with heuristics. 99% of the time it just works the expected way, for the 1% left (or for another set of 1% if we'd fix this special case), one has to find workarounds…

Here the trick is to dissociate the link prefix local: from the follow-up, by using an empty markup span, for example local:``![/optional/path/to], which then renders as local:[/optional/path/to].

in reply to:  14 comment:15 by anonymous, 14 years ago

Replying to cboos:

Here the trick is to dissociate the link prefix local: from the follow-up, by using an empty markup span, for example local:``![/optional/path/to], which then renders as local:[/optional/path/to].

Thanks a lot! You've made my day!

Maxim P. Dementiev

Moscow, Russia

comment:16 by anonymous, 14 years ago

More issues with square brackets:

  1. I want to create the following trac links at the top of my pages, using square brackets: "[Previous] [Next] [Top]"
    I haven't managed to find a way to do that using [http://some.link [Previous]] [http://some.other.link [Next]] as the closing square bracket is no longer part of the link: [Previous] [Next]

  2. Similar issue when wanting to put a subject in square brackets on a mailto: [mailto://some@mailing.list?subject=![SUBJECT] report an issue] becomes: mailto://some@… report an issue]

comment:17 by Remy Blank, 14 years ago

Starting with 0.12, you can use the WikiCreole link syntax, but you will need to add a space between the closing ] and the end of the link if your label ends with ], like so:

  • [[http://some.link/|[Previous] ]][Previous]
  • [[mailto://some@mailing.list?subject=[SUBJECT]|report an issue]] → report an issue

comment:18 by Christian Boos, 14 years ago

Yes, and for "prettifying" the wiki source, you can even add some more space:

[[http://some.link/ | [Previous] ]] 
[[mailto://some@mailing.list?subject=[SUBJECT] |report an issue]] 

Whitespace is stripped, except not after the initial "[[".

I was also wondering about the possible nesting of [[..]] pairs. One use case would be to put such a WikiCreole link inside a macro call, or even nest macro calls…

[[span(style=background:#eee,[[http://some.link/ | [Previous] ]] )]]

But this is a bit more tricky…

comment:19 by TFryar, 14 years ago

Any chance on how to make this work? It is a regular expression that I want to include on a wiki page.

\[1-999\] error\x\(s\x\)

The two "x's" are only there so the line displays pseudo-correctly. Remove the x's and that is what I am trying to display.

Thanks,

Trent

comment:20 by Christian Boos, 14 years ago

`\[1-999\] error\\(s\\)`\[1-999\] error\\(s\\)

comment:21 by anonymous, 11 years ago

What about other characters, like *? How do I get a literal asterisk into a page?

comment:22 by v@…, 11 years ago

How to escape the equal sign "=" at the start of a line?

comment:23 by somenxavier@…, 9 years ago

How can we puy link word scaping the external []?

comment:24 by Christian Boos, 9 years ago

Wiki Markup Rendering
[^^[[link word]]^^]

[link word]

comment:27 by Christian Boos, 7 years ago

Wiki Text Rendered Wiki
^^=

=

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Remy Blank.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Remy Blank to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.