(refs #231)Add anchor icon for headlines in Markdown.

This commit is contained in:
takezoe
2014-02-19 03:19:34 +09:00
parent 521d15219c
commit 78073babe4
4 changed files with 38 additions and 2 deletions

View File

@@ -116,8 +116,9 @@ class GitBucketHtmlSerializer(
val tag = s"h${node.getLevel}"
val headerTextString = printChildrenToString(node)
val anchorName = GitBucketHtmlSerializer.generateAnchorName(headerTextString)
printer.print(s"<$tag>")
printer.print(s"""<a class="anchor" name="$anchorName" href="#$anchorName"></a>""")
printer.print(s"""<$tag class="markdown-head">""")
printer.print(s"""<a class="markdown-anchor-link" href="#$anchorName"></a>""")
printer.print(s"""<a class="markdown-anchor" name="$anchorName"></a>""")
visitChildren(node)
printer.print(s"</$tag>")
}