mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-07 22:15:51 +01:00
(refs #34)@xxxx in markdown as link.
This commit is contained in:
@@ -99,11 +99,14 @@ class GitBucketHtmlSerializer(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override def visit(node: TextNode) {
|
override def visit(node: TextNode) {
|
||||||
// convert commit id to link.
|
// convert commit id and username to link.
|
||||||
val text = if(enableCommitLink) node.getText.replaceAll("(^|\\W)([0-9a-f]{40})(\\W|$)",
|
val text = if(enableCommitLink) node.getText
|
||||||
s"""<a href="${context.path}/${repository.owner}/${repository.name}/commit/$$2">$$2</a>""")
|
.replaceAll("(^|\\W)([0-9a-f]{40})(\\W|$)", s"""$$1<a href="${context.path}/${repository.owner}/${repository.name}/commit/$$2">$$2</a>$$3""")
|
||||||
|
.replaceAll("(^|\\W)@([a-zA-Z0-9\\-_]+)(\\W|$)", s"""$$1<a href="${context.path}/$$2">@$$2</a>$$3""")
|
||||||
else node.getText
|
else node.getText
|
||||||
|
|
||||||
|
println(text)
|
||||||
|
|
||||||
if (abbreviations.isEmpty) {
|
if (abbreviations.isEmpty) {
|
||||||
printer.print(text)
|
printer.print(text)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user