Fix links to headings in the sidebar ToC

The ids in the body of the HTML output now include the context of the
heading to keep them unique, but this was not updated in the sidebar
table of contents.

Now the sidebar table of contents and the headings generate their labels
from the same method, RDoc::Markup::Heading#label
Ignore "]" following an RDOCLINK

This caused problems when an RDOCLINK was discovered inside a TIDYLINK.
The ] wouldn't indicate the end of the RDOCLINK (any non-whitespace) so
it would consume the ] and any following punctuation.

This would cause a TIDYLINK to be unrecognized.

The handling of markup inside a paragraph needs its own parser one of
these days.
Test TIDYLINK regular expression