Submitted by : simon at: 2003-10-26T21:32:02+00:00 (14 years ago)
Name :
Category : Severity : Status :
Optional subject :  
Optional comment :

The following bracket notations need to be masked from wikilinks:

 \n.. [ ] (footnotes), 
 [ ]_ (footnote citation)


comments:

property change --simon, Sat, 27 Sep 2003 21:40:51 -0700 reply
Category: general => formatting and rendering

... --Bob McElrath?, Mon, 01 Nov 2004 10:37:08 -0800 reply
The way this is fixed for stx is in ZWikiPage.renderLink, where we search the entire document for footnotes, and do not mark as a wikilink anything which has a corresponding wikilink. This could also be done for reST, but ZWikiPage.renderLink is an inappropriate place to do it. This needs to be in the pagetype code itself. I suggest the reST pagetype inherit the HTMLTranslator? class (in docutils/writers/html4css1.py) and override the methods visit_citation_reference and/or visit_footnote_reference to escape the link with !.

My newstx will fix the similar bug for stx, but it will require removal of the old stx and rewriting of ZWikiPage.renderLink, otherwise we will re-introduce this bug for the old stx.

property change -- Sun, 30 Jan 2005 08:51:50 -0800 reply
Category: user-pagetypes => user-editing-rst

is this open? --betabug, Wed, 21 Feb 2007 08:14:22 +0000 reply
Name: #512 reynaldo => #512 reStructuredText bracket and freeformlink collisions Category: user-browsing => user-editing-rst Severity: funded => normal Status: closed => open

don't know if I should put this close or open...

yes --simon, Thu, 22 Feb 2007 20:12:42 +0000 reply
Yes, this whole issue still needs review and fixing or clear documentation.

got it fixed, but can't send in to darcs :-( --betabug, Fri, 23 Mar 2007 08:26:21 +0000 reply
I've got this fixed. Actually it doesn't need an workaround code at all. It is in fact a simple bug that needed fixing. The problem was that RST generated code like <a name="somename" href="something"... while we were looking for <a href=. As soon as I can send in to darcs this can be closed.

Here is the patch for now (get it from the page source and remove 2 spaces at the start of each line to get a "real" patch to use):

  --- old-ZWiki/ZWikiPage.py      2007-03-23 10:46:32.000000000 +0200
  +++ new-ZWiki/ZWikiPage.py      2007-03-23 10:46:33.000000000 +0200
  @@ -1462,12 +1462,26 @@

       # Check whether '<a href...>' is currently (possibly, still) prevailing.
       #XXX make this more robust
  -    opening = rfind(text, '<a href', lastend, upto)
  -    if (opening != -1) or inanchor:
  +    opening = rfind(text, '<a ', lastend, upto)
  +    got_anchor = opening != -1
  +    # we used to be looking for '<a href', but attribute order can
  +    # actually be the other way around, e.g. RST generating <a name=...
  +    href_too = False
  +    if got_anchor or inanchor: # found or already in anchor
  +        if got_anchor: # found it here
  +            # it might just have been <a name...>
  +            href_too = -1 != rfind(text, 'href', opening, upto)
  +            # if not href_too: opening = -1
           if opening != -1: opening = opening + 5
           else: opening = lastend
  -        if -1 == rfind(text, '</a>', opening, upto):
  -            newinanchor = 1
  +        got_anchor_closing = -1 == rfind(text, '</a>', opening, upto)
  +        if href_too and got_anchor_closing:
  +            newinanchor = 1 # the <a name=... href=...>WikiName</a> case
  +        elif got_anchor_closing:
  +            newinanchor = 0 # the <a name>WikiName</a> case
  +        # this would be: elif got_anchor and not got_anchor_closing:
  +            # the "<a name>WikiName - no closing" case is handled implicitly
  +            # newinanchor stays the same as initialized = 0
       state['inanchor'] = newinanchor

       state['lastend'] = after

in 0.59 --simon, Mon, 26 Mar 2007 20:37:07 +0000 reply
Status: open => closed

Looks like this did not make it into 0.59, reopening --betabug, Wed, 16 May 2007 06:14:32 -0700 reply
Status: closed => open

I just had the problem on my production server, was still running 0.59rc2, so I upgraded to 0.59... but the fix still wasn't in there. Going to the darcs code now I've got it. I'll double check that the patch is sent in all right. Reopenin for now.

simon, this fix didn't make it into 0.59, it should be in there --betabug, Wed, 16 May 2007 06:22:06 -0700 reply
Downloading 0.59 and grepping through ZWikipage.py I can not find got_anchor. Looks like this code had not been pulled for the 0.59 release.

A case for 0.59.1 if we do that? Or how else should we handle this?

simon, this fix didn't make it into 0.59, it should be in there --simon, Thu, 17 May 2007 09:36:31 -0700 reply
More data:

(11:45:24) sm: Fri Mar 23 01:39:43 PDT 2007 betabug (11:45:25) sm: * 512 - fix footnotes with "create page" links in RST (11:45:25) sm: in the repo, back in march (11:48:07) sm: http://joyful.com/darcsweb/darcsweb.cgi?r=ZWiki;a=commitdiff;h=20070323083943-b6ddc-59c42dc4900d2dde880bc245724f92e25002b29b.gz (11:50:15) sm: it does seem to be still there alright.. http://joyful.com/darcsweb/darcsweb.cgi?r=ZWiki;a=headblob;f=/ZWikiPage.py#l1468 (11:50:27) sm: more will be revealed, no doubt

closing --simon, Fri, 31 Aug 2007 00:58:21 -0700 reply
Status: open => closed

I believe this is in 0.60, at least.