google-code-export / gaewiki

Automatically exported from code.google.com/p/gaewiki
1 stars 0 forks source link

[] inside links #64

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

I can't seem to create links that contain [].

For example:

[[Test|Test:Int[]()]]

I've also tried:

[[Test|Test:Int\[\]()]]

Which is better, but still doesn't create a link.

Is there perhaps another way to do this?

Original issue reported on code.google.com by blitzmun...@gmail.com on 15 Jan 2012 at 2:36

GoogleCodeExporter commented 9 years ago
Looks like the only way to have that link currently is to use Markdown:

  [Test:Int[]()](Test)

Thanks for reporting this issue.

Original comment by justin.forest on 15 Jan 2012 at 4:07

GoogleCodeExporter commented 9 years ago
This issue was updated by revision 93136bd87be6.

You can now use square brackest in links, e.g.:

[[Test|Test:Int[]()]] -- this works.

Original comment by justin.forest on 19 Feb 2012 at 8:24

GoogleCodeExporter commented 9 years ago
Mark, pease reopen this if you find any other issues with links in the current 
version (Mercurial).

Original comment by justin.forest on 19 Feb 2012 at 8:37

GoogleCodeExporter commented 9 years ago
Hi,

This has broken multiple internal links on the same line, eg: [[X]] [[Y]] [[Z]] 
are considered to be a single link.

I'm fairly new to regex stuff, but in util.py I think you need to use:

WIKI_WORD_PATTERN2 = re.compile("\[\[(.+?)\]\]")

Otherwise, it's matching the 'longest' [[ ]] content.

Also, your code appears to use both WIKI_WORD_PATTERN and WIKI_WORD_PATTERN2 - 
but the first is broken, isn't it?

Original comment by blitzmun...@gmail.com on 20 Feb 2012 at 2:24

GoogleCodeExporter commented 9 years ago
Hi,

Don't know how to re-open an issue...but this still isn't quite fixed.

The [] issue is fixed, but it now considers multiple internal links on
the same line to be a single link.

I think you need to add a ? to the regex to match the 'shortest' text, eg:

WIKI_WORD_PATTERN2 = re.compile("\[\[(.+?)\]\]")

Otherwise, [[X]] [[Y]] [[Z]] is considered to be a single long link.

Also, WIKI_WORD_PATTERN is still used in the code in extract links,
but it's broken isn't it?

Bye,
Mark

Original comment by blitzmun...@gmail.com on 20 Feb 2012 at 2:29

GoogleCodeExporter commented 9 years ago
Right.

Original comment by justin.forest on 20 Feb 2012 at 6:33

GoogleCodeExporter commented 9 years ago
This issue was updated by revision 5cd5250d8532.

Fixed greedy wikiword regexp, added a test case.

Original comment by justin.forest on 20 Feb 2012 at 6:35