Since we now have a custom parser for <ac:*/> tags, the custom link
renderer added an additional </a> tag at the end of each internal
Confluence link.
Add tests for internal links and add an example for internal links with
spaces in page titles to the README file.
This replaces the workaround to replace colons in <ac:*/> tags with a
magic string with a custom parser for these tags to parse them as
ast.KindRawHtml.
The custom parser is a stripped down version of goldmark's rawHTMLParser.
This change replaces the unmaintained blackfriday markdown renderer with the
goldmark renderer.
The goal is to have wider support for more markdown extensions and ideally
have a better solution for mermaid transformation via extensions as well.
Allows switching between the "full-width" and "fixed" page layouts.
The "fixed" layout renders the page in a narrow column. (Confluence
default)
If not configured, it defaults to "full-width".
When a macro is set in the header, only the first line will be read and then
discarded. This makes sure we keep the macro in and stop processing metadata
when we hit a macro.
Co-authored-by: Manuel Rüger <manuel@rueg.eu>
While a page with a macro is processed, having a macro leaves an unclean buffer
for further processing steps, including title extraction. The problem seems to
come from `ExtractMeta`: as it runs through the metadata, it hits the first
line of the macro but since it doesn't look like a complete Metadata (e.g.
matching either `\[\]:\s*#\s*\(([^:]+):\s*(.*)\)` or
`<!--\s*([^:]+):\s*(.*)\s*-->` in
https://github.com/kovetskiy/mark/blob/master/pkg/mark/meta.go#L37:L38, it will
break the loop in
https://github.com/kovetskiy/mark/blob/master/pkg/mark/meta.go#L61 and return
the final document as:
```
Template: ac:children
Style: h2
Excerpt: none
Page:
TestSpace:Test
Reverse: false
All: true -->
:children:
```
This then goes into `ExtractDocumentLeadingH1` which doesn't find a match for
the regex `^#[^#]\s*(.*)\s*\n`, returning an empty title since the title is not
on the first line. This commit, while it doesn't fix the unclean document,
fixes the regex to properly find the title.
Closes#214