Jump to content

Topic on Project:Support desk

Square brackets in page titles / links

7
Liamgretton (talkcontribs)

I'm porting a lot of content from a commercial Wiki system to MediaWiki but have many pages with square brackets in the page titles. It's starting to look like MW can't cope with page names (and links) containing square brackets.

I've tried using entities ([ and ]) but that doesn't work. I can't find any documented means of escaping characters.

Are square brackets completely forbidden in page titles and links? How does one deal with external URLs which contain square brackets?

MarkAHershberger (talkcontribs)

When you are specifying URLs in Wikitext, you should use %91 and %93. See URI encoding.

Liamgretton (talkcontribs)

Ok thanks, that seems to deal with external links. But those encodings don't help with page titles or internal links - if I try to create a page with %91 and %92 they get translated to sexed versions of ' and " respectively.

MarkAHershberger (talkcontribs)
Ciencia Al Poder (talkcontribs)

[ and ] are not allowed on page names, since that conflicts with the internal link syntax. You should use a replacement characters. For example, parentheses.

Qdinar (talkcontribs)

%5B and %5D work

203.206.139.2 (talkcontribs)

You can escape markup using the <nowiki> tag, even in link titles.

For example,

Seafolly v Fewstone [http://www.austlii.edu.au/au/cases/cth/FCA/2014/321.html <nowiki>[2014]</nowiki> FCA 321]

gives the required:

Seafolly v Fewstone [2014] FCA 321

Reply to "Square brackets in page titles / links"