This patch was the simplest I could come up with to fix the named anchor problem. The bug has to do with placing a # sign in the named anchor, rather than using it in the link, so there were problems with both parts of the anchor/link pair.
The main issue with the fix is tracking the difference between a normal link and a link to a named anchor.
<a href="commons.html">commons.html</a> <!-- from commons.html -->
vs
<a href="commons">commons</a> <!-- from commons -->
for instance, where the named anchor would be:
<a name="#commons">commons</a> <!-- from
{commons}
-->
So some alternatives would be:
a. to store a list of named anchors to search against when creating a link
b. to check the link text to see if you could decide based on network protocols (ie http://) or extensions (ie .htm) whether this should be a URL to a named anchor or not.
c. to change the APT format slightly to give a hint as to what to do
I opted for c, since it involved the least code change, and should work in all instances. That's what this patch does. I think it makes adequate sense to differentiate the syntax which refers to a named anchor from other types of links. Now, the syntax would be as follows, in APT:
An . Link to #anchor. Link to http://www.pixware.fr.
Link to {{
{#anchor}
anchor showing alternate text}}.
Link to {{
{http://www.pixware.fr}
Pixware home page}}.
The only difference is the # sign, which is stripped for display if we're in the middle of a link.
Related to http://jira.codehaus.org/browse/DOXIA-29