mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-12 00:15:50 +01:00
Fix behavior when enableAnchor is false
This commit is contained in:
@@ -162,16 +162,14 @@ class GitBucketHtmlSerializer(
|
||||
val tag = s"h${node.getLevel}"
|
||||
val headerTextString = printChildrenToString(node)
|
||||
val anchorName = GitBucketHtmlSerializer.generateAnchorName(headerTextString)
|
||||
if(enableAnchor){
|
||||
printer.print(s"""<$tag class="markdown-head">""")
|
||||
if(enableAnchor){
|
||||
printer.print(s"""<a class="markdown-anchor-link" href="#$anchorName"></a>""")
|
||||
printer.print(s"""<a class="markdown-anchor" name="$anchorName"></a>""")
|
||||
}
|
||||
visitChildren(node)
|
||||
if(enableAnchor){
|
||||
printer.print(s"</$tag>")
|
||||
}
|
||||
}
|
||||
|
||||
override def visit(node: HeaderNode): Unit = {
|
||||
printHeaderTag(node)
|
||||
|
||||
Reference in New Issue
Block a user