104 Commits

Author SHA1 Message Date
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
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
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
9840c01e8a Include space parameter as well 2023-03-20 22:54:11 +01:00
Manuel Rüger
20d3d1f05c fix: Support relative links with titleFromH1 2023-03-20 19:43:01 +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
Fethbita
df3e95f5fd
Merge branch 'kovetskiy:master' into master 2023-02-13 16:46:45 +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
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
Noam Asor
ce9573a86e To add fallack to blockquote when type is none 2023-01-28 21:15:31 +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
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
7204ef21f6 Lint: Disable staticcheck for strings.Title
strings.Title is deprecated, but we need to keep using it since there is
no 1:1 replacement and otherwise this might change page names on
confluence.
2023-01-18 19:46:27 +01:00
Lucas Oskorep
6083ddcc88 fix: rendermode typo broke builds 2023-01-17 12:46:49 -05:00
Manuel Rüger
2f39cd80e7
Merge pull request #234 from Nr18/feat/jiraissues
feat: support ac:jiraissues macro
2023-01-16 15:23:18 +01:00
Manuel Rüger
8deecfd67a Lint 2023-01-05 11:37:42 +01:00
Noam Asor
8c02497b5f
Feature/prokod/#194 (#237)
* Initial commit (w/ debug)

* To remove debug
2023-01-04 08:54:15 +00:00
Zackery Griesinger
90d8729a7d
Fix for jira.com hosted sites (#231) 2023-01-03 17:54:30 +00:00
Manuel Rüger
3e558ac2e3
Replace deprecated io/ioutils (#230) 2023-01-03 17:54:04 +00:00
Stephan Hradek
f4bbbb19ca
Feature/themed blocks (#223)
* Allow themed blocks

* add macro code for themed blocks
2023-01-03 17:53:41 +00:00
Stephan Hradek
0b745c25e4
This should fix #171 by allowing a markdown link to start with ac: (#222) 2023-01-03 17:53:20 +00:00
Joris Conijn
5f3238b48a
feat: support ac:jiraissues macro
Add support for the `ac:jiraissues` macro. By adding the template to the stdlib. Not sure if there are other places where you need to add stuff for macros. Or how I could test this locally.
2022-12-13 11:56:27 +01:00
Egor Kovetskiy
1ebb29eba0 small style fixes related to templates 2022-10-19 20:43:40 +06:00
Manuel Rüger
78345736d5
go.mod: Update dependencies (#211)
Also switch to yaml.v3
2022-10-19 20:43:12 +06:00
Toru Kawaguchi
d276b7e78a
Correct attachment name to include path on update (#215) 2022-10-19 20:42:32 +06:00
recrtl
49c25c2c29
fix 178: update breaks on more than 50 attachments (#220) 2022-10-19 20:38:49 +06:00
Egor Kovetskiy
e1d8eccfff fix ancestry search
Signed-off-by: Egor Kovetskiy <e.kovetskiy@gmail.com>
2022-06-28 16:58:44 +06:00
Stephan Hradek
abfd01cc74
fix issue 177 (#200) 2022-06-10 10:13:22 +06:00
Stephan Hradek
39dfdec099
fix 142 redone for current master (#199) 2022-06-07 14:16:24 +06:00
Stephan Hradek
9ec7728d08
introduce inline templates (#198) 2022-06-07 10:26:15 +06:00
Stephan Hradek
3c7bd6133f
allow templates and macros to include blanks in path (#191) 2022-06-06 12:35:48 +06:00
Joel Andritsch
5ad1a4abe5
bugfix: Force pages to default width. (#175)
This change is to compensate for an API bug in Confluence where newly
create pages end up getting a random width of either "fixed" or "full".

Fixes #173
2022-04-22 15:16:46 +06: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
9a4f9ff32d
Add subdirectories related templates (#158) 2022-02-02 16:02:01 +06:00
Dreampuf
2251e8ad8a
Add footnotes support (#156) 2022-02-02 16:01:38 +06:00
Pommier Vincent
c8709eecd1
feat: Add support of confluence server. (#154) 2022-02-02 16:01:26 +06:00
Egor Kovetskiy
b15f1f8e70 bump to 7.0 2022-01-18 12:10:46 +06:00
klysunkin
9a7146c7d7
Fix for subdirectories related attachments (issue #31) (#151) 2022-01-18 12:07:36 +06:00
klysunkin
8d58ff26a3
Space from config and title from h1 (#153)
* Add option to define Space.
Add option to use H1 heading to define page title.

* Update readme
2022-01-18 12:05:26 +06:00
Egor Kovetskiy
9cde833a18 fix updating attachments when confluence returns a short response object 2021-12-09 11:46:57 +06:00
guoweis-outreach
08f37fe2b9
feat: add iframe support (#143)
* feat: add iframe support

* add comment
2021-12-09 11:14:01 +06:00
Egor Kovetskiy
f0e00468e9 use AutoLink rule to all links except ac: namespace 2021-11-11 14:45:08 +06:00
Egor Kovetskiy
1bd022b065 replace \r\n with \n, fix #42 2021-11-08 20:15:59 +06:00
jevfok
f3ba7c57a3
Children display macro (#133)
Added Children Display macro
2021-11-08 20:12:13 +06:00