26 Commits

Author SHA1 Message Date
Stephen Paulger
aaae918478
Fix layout section attribute tags (#401)
* Fix attribute tags

* Update test date to expect attribute with ac: prefix
2023-12-19 13:57:52 +01:00
Manuel Rüger
04bf20c0a3 change: Move back to XHTML 2023-10-23 21:12:37 +02:00
Manuel Rüger
8e16f6f29c change: Move from XHTML to HTML5 2023-10-18 15:29:16 +02:00
Judson Lester
20c65ca373 Adding linebreak stripping 2023-09-07 21:30:52 +02:00
Manuel Rüger
0b6dd09013 Drop newlines completely from macros 2023-05-23 12:30:46 +02:00
Manuel Rüger
9a37fc4713 Drop newlines within macros
Newlines will cause trouble when rendering and the macro is used inside
a table.
2023-05-23 11:49:04 +02:00
Rémi Courtel
eba2396010 fix 305: external images URLs are not properly escaped 2023-05-05 14:41:59 +02:00
Manuel Rüger
622be6e25f Support customizable layouts 2023-05-05 10:52:04 +02:00
Manuel Rüger
fd97ee70f9 Support inline images 2023-05-03 18:47:20 +02:00
Bernd Ahlers
80d906417c
Fix custom link renderer and add tests for Confluence links
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.
2023-03-31 11:09:58 +02:00
Bernd Ahlers
6e4a912b11
Implement a custom parser for <ac:*/> tags
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.
2023-03-31 10:51:50 +02:00
Bernd Ahlers
238ae29b59
Fix "<ac:*>" tag rendering
Extend the existing workaround to avoid HTML element escaping to handle
more variants.
2023-03-30 14:30:15 +02:00
Manuel Rüger
6265c7ff81 Render CodeBlocks properly 2023-03-29 15:45:11 +02:00
Manuel Rüger
a3dc8bed05 Replace blackfriday with goldmark
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.
2023-03-27 20:36:43 +02:00
Noam Asor
ce9573a86e To add fallack to blockquote when type is none 2023-01-28 21:15:31 +01:00
Guillaume Hérail
667e7be221 fix: Title not being extracted when not on the first line
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
2023-01-25 11:51:56 +01:00
Noam Asor
8c02497b5f
Feature/prokod/#194 (#237)
* Initial commit (w/ debug)

* To remove debug
2023-01-04 08:54:15 +00:00
Philipp
f95835469c
fix: remove double collapse for codeboxes (#179)
This fixes a bug where if you used the code macro the renderer would create
an additional expand macro if the collapse option was set. This led to
the code section being collapsiable twice.

Co-authored-by: Philipp Reinke <philipp.reinke@scandio.de>
2022-04-22 15:16:04 +06:00
Dreampuf
2251e8ad8a
Add footnotes support (#156) 2022-02-02 16:01:38 +06:00
Egor Kovetskiy
f0e00468e9 use AutoLink rule to all links except ac: namespace 2021-11-11 14:45:08 +06:00
Leandro Carneiro
e635d1f945
feat: support mermaid graphs (#128) 2021-10-25 15:51:56 +06:00
Egor Kovetskiy
3fcfcde298 add table test 2021-09-09 13:12:58 +03:00
Egor Kovetskiy
c17a3d02d0 fix regression after #60 2021-02-04 12:18:28 +03:00
Egor Kovetskiy
931d9f706a confirm #64 by a test (broken now) 2021-02-04 11:58:44 +03:00
Egor Kovetskiy
7f6466a882 upgrade to blackfriday v2, fixes #53 and #61, add tests 2021-02-02 17:44:56 +03:00
Egor Kovetskiy
e190cdfb34 rollback #53 because of #63, add tests 2021-02-02 17:44:56 +03:00