diff --git a/README.md b/README.md index 99cb3dbc..83cca549 100644 --- a/README.md +++ b/README.md @@ -440,6 +440,14 @@ You can use various [parameters](https://confluence.atlassian.com/conf59/childre See task MYJIRA-123. ``` +### Insert link to existing confluence page by title + +```markdown +This is a [link to an existing confluence page](ac:Pagetitle) + +And this is how to link when the linktext is the same as the [Pagetitle](ac:) +``` + ## Installation ### Homebrew diff --git a/pkg/mark/markdown.go b/pkg/mark/markdown.go index 06c2128e..85b060b3 100644 --- a/pkg/mark/markdown.go +++ b/pkg/mark/markdown.go @@ -73,6 +73,21 @@ func (renderer ConfluenceRenderer) RenderNode( return bf.GoToNext } + if node.Type == bf.Link && string(node.Destination[0:3]) == "ac:" { + if entering { + writer.Write([]byte("")) + return bf.SkipChildren + } + return bf.GoToNext + } return renderer.Renderer.RenderNode(writer, node, entering) }