Dear All,

working with markdown command, I am puzzled why the headers, such as
Code:
# Example
are translated into the fragment of HTML as:
Code:
<h1><a href="#example" id="example">Example</a></h1>
Including the id is useful for jumping to the anchor, but I am puzzled for including the href to the same spot. It simply causes the header to be rendered as a link (which is confusing), but otherwise nothing useful.

Is this a common markdown strategy? Or is this specific to Stata only?
Is this somehow controllable?


I tried to follow to the source of Pegdown here: https://github.com/sirthias/pegdown but it says that
EXTANCHORLINKS: Generate anchor links for headers using complete contents of the header.
  • Spaces and non-alphanumerics replaced by -, multiple dashes trimmed to one.
  • Anchor link is added as first element inside the header with empty content: <h1><a name="header"></a>header</h1>
which seems to be a different code than that produced by Stata.

PS: the github page for pegdown mentions that "pegdown has reached its end of life" since about 4 years ago. So not sure whether Stata includes the exact same code or just the language dialect with a different implementation.

Thank you, Sergiy Radyakin