diff --git a/scripts/mkdocs2pdf.py b/scripts/mkdocs2pdf.py
index 54012b0e52776cb76b049aa1868cd7c97c0f2456..a51bfd25e07de3155c4d0caa2600e086f20b28f9 100644
--- a/scripts/mkdocs2pdf.py
+++ b/scripts/mkdocs2pdf.py
@@ -226,7 +226,7 @@ def buildDocForLang(lang):
     mergedDocFilename = mergedDocFilenamePrefix + lang
     mergedDocOutputPath = os.path.join(pdfBuildDir, mergedDocFilename)
     # remove internal links @TODO convert them to hyperref ?
-    s = re.sub(r'\[([^/]+)\]\([^ ]+\.md\)', r'\1', s)
+    s = re.sub(r'\[([^/\^]+?)\]?\([^ ]+?\.md\)', r'\1', s)
     with open('{}.md'.format(mergedDocOutputPath), 'w') as f:
         f.writelines(s)