477 Commits

Author SHA1 Message Date
Manuel Rüger
1285947ab3 feat: Support page inclusion macro
Also generalize the ac_tag_parser a bit and support <ri:* /> tags as
well
2023-03-31 16:47:24 +02:00
Manuel Rüger
943a356508 Bump version to 9.0.3 9.0.3 2023-03-31 11:40:29 +02:00
Manuel Rüger
8193f2d466
Merge pull request #273 from bernd/fix/issue-272
Implement a custom parser for `<ac:*/>` tags
2023-03-31 11:35:42 +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
Manuel Rüger
e7e61ba234 Bump version to 9.0.2 9.0.2 2023-03-30 15:02:05 +02:00
Manuel Rüger
a60dd52442
Merge pull request #270 from bernd/fix/ac-tag-escaping
Fix "<ac:*>" tag rendering
2023-03-30 15:01:03 +02:00
Bernd Ahlers
974de93ef1
Rename variable 2023-03-30 14:34:19 +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
98e15ed7ff Bump version to 9.0.1 9.0.1 2023-03-29 15:57:13 +02:00
Manuel Rüger
fca934f90c
Merge pull request #268 from mrueg/fix-codeblock
Render codeblocks properly
2023-03-29 15:56:23 +02:00
Manuel Rüger
6265c7ff81 Render CodeBlocks properly 2023-03-29 15:45:11 +02:00
Manuel Rüger
fef66925d1 Bump version to 9.0 2023-03-29 11:01:07 +02:00
Manuel Rüger
93218f1e69
Merge pull request #260 from mrueg/switch-to-goldmark
Replace blackfriday with goldmark
9.0
2023-03-28 16:54:04 +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
Manuel Rüger
3dd6d0ab99 Bump version to 8.10 8.10 2023-03-27 20:16:21 +02:00
Manuel Rüger
700cbc139a
Merge pull request #265 from lucasoskorep/fix/relative-links
Fix: Relative links extractmetadata files for filetypes other than markdown.
2023-03-23 08:01:46 +01:00
Lucas Oskorep
30b0785fae feat: moving to IsTextFile for file type detection 2023-03-22 19:14:34 -04:00
Lucas Oskorep
67c9b248dd fix: extract metadata fails for file types which are not .md 2023-03-22 15:45:14 -04:00
Manuel Rüger
d00d94afa3 Bump to version 8.9 8.9 2023-03-21 11:09:47 +01:00
Manuel Rüger
530ff5cc3c
Merge pull request #262 from mrueg/fix-relative-links
fix: Support relative links with titleFromH1
2023-03-21 11:07:59 +01:00
Manuel Rüger
9840c01e8a Include space parameter as well 2023-03-20 22:54:11 +01:00
Manuel Rüger
21cf51efd7 Clean up logic a bit 2023-03-20 19:56:02 +01:00
Manuel Rüger
20d3d1f05c fix: Support relative links with titleFromH1 2023-03-20 19:43:01 +01:00
Manuel Rüger
eab5655456
Merge pull request #258 from bernd/add/content-appearance-option
Add Content-Appearance header
2023-03-06 15:00:18 +01:00
Bernd Ahlers
9e656ece15
Add Content-Appearance header
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".
2023-03-06 10:09:28 +01:00
Manuel Rüger
4b5e9c23ec
Merge pull request #256 from mrueg/bump-8.8
Bump version to 8.8
8.8
2023-02-21 15:25:34 +01:00
Manuel Rüger
c0bc7dcd35 Bump version to 8.8 2023-02-21 14:56:37 +01:00
Manuel Rüger
cea051057a
Merge pull request #255 from mrueg/build-image
Build image
2023-02-21 14:49:22 +01:00
Manuel Rüger
2a9f830817 .github: Add build image step 2023-02-21 14:46:46 +01:00
Manuel Rüger
ca2dbe5fc4 Dockerfile: Freeze builder image versions 2023-02-21 14:46:42 +01:00
Manuel Rüger
e754bf17a0
Merge pull request #250 from Fethbita/master
ac:image macro
2023-02-13 15:50:17 +01:00
Fethbita
df3e95f5fd
Merge branch 'kovetskiy:master' into master 2023-02-13 16:46:45 +02:00
Fethbita
24aa73e243
Add width keyword for html comment 2023-02-13 16:46:06 +02:00
Manuel Rüger
fb8e589bc4
Merge pull request #252 from mrueg/add-blog-posts-macro
Add blog-posts macro
2023-02-07 15:43:48 +01:00
Manuel Rüger
20ba4dd8fe
Merge pull request #251 from jay-stillman/issue/173
bugfix: Remove forced default width, forced full-width
2023-02-07 13:50:12 +01:00
Manuel Rüger
738400c292 Add blog-posts macro 2023-02-06 18:16:39 +01:00
Jay Stillman
4d16a1f606 bugfix: Remove forced default width, forced full-width without editor config #175 2023-02-06 01:18:34 -05:00
Fethbita
e0222ae6bd
Add ac:image width and edited README.md 2023-02-04 15:20:21 +02:00
Sylvain Malnuit
8debc23476
ac:image 2023-02-04 15:15:47 +02:00
Manuel Rüger
b82e18f8b8
Merge pull request #248 from prokod/bugfix/prokod/#247
To add fallback to blockquote when type is none
2023-01-31 14:18:48 +01:00
Noam Asor
ce9573a86e To add fallack to blockquote when type is none 2023-01-28 21:15:31 +01:00
Manuel Rüger
cd08a70ba9 .github: Build with go 1.19 8.7 2023-01-27 11:40:46 +01:00
Manuel Rüger
d09ee6ea22 Bump version to 8.7 2023-01-27 11:38:15 +01:00
Manuel Rüger
adee0189bd
Merge pull request #244 from xiu/fix/214
fix: Title not being extracted when not on the first line
2023-01-27 11:37:00 +01:00
Guillaume Hérail
1b3c7b4127 fix: Properly handle macro when extracting Metadata
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>
2023-01-26 17:01:47 +01:00
Manuel Rüger
8a1bd88577
Merge pull request #246 from mrueg/bump-deps
go.mod: Update dependencies
2023-01-26 10:44:42 +01:00
Manuel Rüger
fb8213bc0d go.mod: Update dependencies 2023-01-26 09:49:40 +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
Manuel Rüger
5ff8daf5e1
Merge pull request #243 from mrueg/fix-lint
Lint: Disable staticcheck for strings.Title
2023-01-19 11:35:06 +01:00