fix($client/outline): select an appropriate anchor in the outline when
highlighting

To highlight the current progress in the outline (currently indicated by
bold in the black and white theme), the first currently visible heading
tag (h1-6) is selected. If no heading tags are currently visible, the
closest tag immediately above the viewport area is selected as that
would be the most immediate previous tag because scrolling is in a _top
to bottom_ direction.

The id of this selected heading tag is then used to match an appropriate
anchor tag in the outline to highlight.

Before this commit, if the selected heading tag is outside the outline's
depth level, no anchor tag is highlighted even though there should be.

For example, if the selected heading tag is a 'h3' tag, but the outline
depth is only 2, there will be no corresponding anchor in the outline to
this heading tag as the outline only covers h1 and h2 tags in this case
(because the depth is 2).

However, the anchor tag that corresponds to the selected h3 tag's
immediate parent which is still within the outline depth (in this case,
the anchor tag that corresponds to the closest h2 tag before the
selected h3 tag) should be highlighted as the current section is still a
part of this larger parent as suggested by the hierarchy of the outline.

The outline is directly generated by pandoc, and hence the hierarchy of
the outline is determined by h1-6 tags in this manner. (I do not think
'section' or other similar such tags have an affect on the
pandoc-generated outline even though the html5 standard suggests it can
or should.)

Closes #1.