Markdown internal links not working in BitBucket README.md

I'd check the generated html on the anchor tag, from what I can recall of bitbuckets auto-ids I suspect your link needs to look more like

* [Document Organization](#markdown-header-document-organization)

This may do as well.

According to this: https://confluence.atlassian.com/bitbucket/mark-up-comments-305037452.html, bitbucket supports the Table of Contents extension which can auto-generate links and anchors based on the document headers.

The TOC extension is documented here: https://pythonhosted.org/Markdown/extensions/toc.html

Add the text "[TOC]" to the beginning of the document for it to be generated.


Here's a snippet to generate a Table of Contents for Bitbucket readmes (or other markdown files).

cat readme.md  |\
grep "^#" |\
sed 's|^[ ]*||g' |\
awk  -F, '\
BEGIN {
}{
  basic_name=$1;
  anchor=basic_name
  basic_name_no_hash=basic_name
  gsub(/^[#]* /,"",basic_name_no_hash)
  gsub(/[ ]*$/,"",basic_name_no_hash)
  subs_string=basic_name
  subs = gsub(/#/,"",subs_string);
  gsub(/^[#]+ /,"",anchor);
  gsub(/ /,"-",anchor);
  anchor = tolower(anchor);
  {for (i=0;i<subs-1;i++) printf "    " }
  print "* [" basic_name_no_hash "](#markdown-header-" anchor ")";
}
END {
}'