Round brackets in named link urls causes parsing problems
Multi-language source code documentation tool
Brought to you by:
gregvalure
The presence of round brackets () in urls for named links results in unexpected output.
For example, the following works as expected:
<the year 42 at http://en.wikipedia.org/wiki/42>
But the following does not:
<the number 42 at http://en.wikipedia.org/wiki/42_(number)>
instead we see something like:
<the number 42 at url target=”http://en.wikipedia.org/wiki/42_” name=”http://en.wikipedia.org/wiki/42_”(number)>
unnamed link urls also work as expected.
<http://en.wikipedia.org/wiki/42_(number)>
Really annoying for links to wikipedia which often contain round brackets for disambiguation.
Open [ND Dir]\Modules\NaturalDocs\Parser\Native.pm
Search for the string "acceptable URL characters".
There will be three lines following it that look similar to this:
On each of them, right before the closing square bracket add "\(\)", like so:
Run Natural Docs once with -r to apply the changes everywhere.
That works very well, thank-you.
FYI: on page 15 of http://www.w3.org/Addressing/URL/url-spec.txt,
a path segment is defined (BNF) to include the following:
safe: $ | - | _ | @ | . | & | + | -
extra: ! | * | " | ' | ( | ) | ,
so a patch should probably also add the dollar sign and exclamation mark.
Last edit: Adam Clarke 2012-12-17