bsorrentino / maven-confluence-plugin

Maven plugin that generates project's documentation directly to confluence allowing to keep in-sync project evolution with its documentation
http://bsorrentino.github.io/maven-confluence-plugin/
Apache License 2.0
69 stars 34 forks source link

ignore markdown-lint tags when publishing pages #284

Closed BigMichi1 closed 1 year ago

BigMichi1 commented 1 year ago

we are currently validating all our markdown files that will be published to confluence by https://github.com/DavidAnson/markdownlint

at some places we are disabling the lining via <!-- markdownlint-disable --> and enabling it afterwards via <!-- markdownlint-enable -->

the problem now is that when these pages are published to confluence it fails

12:18:48.057  [INFO] [ERROR] Failed to execute goal org.bsc.maven:confluence-reporting-maven-plugin:7.8:deploy (deploy) on project checkstyle: error generating report: error: create page
12:18:48.057  [INFO] [ERROR] Response{protocol=http/1.1, code=500, message=, url=[https://confluence.xxx.de/rest/api/content}](https://confluence.xxx.de/rest/api/content%7D)
12:18:48.057  [INFO] [ERROR] {"statusCode":500,"data":{"authorized":false,"valid":true,"allowedInReadOnlyMode":true,"errors":[],"successful":false},"message":"com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'html' is unknown.","reason":"Internal Server Error"}
12:18:48.057  [INFO] [ERROR] -> [Help 1]

is there any way to ignore these tags before sending the page to confluence?

bsorrentino commented 1 year ago

Hi @BigMichi1 thanks for feedback

looking reported error it is The macro 'html' is unknown.. In my experience this cannot be related to plugin but to the confluence server. I Think that you've to enable support for "html macro" from confluence server side

Take look to

BigMichi1 commented 1 year ago

thx, we checked it and the plugin is disabled and can not be enabled because of some company policies forbidding HTML content in confluence. any way to bypass these HTML content blocks when publishing/transforming the page, maybe with an option?

BigMichi1 commented 1 year ago

tested against a confluence server on my own and HTML plugins are enabled but still the same error appears. strange. removing these two commends in the markdown for disabling and enabling and it works on both confluence servers (with and without HTML plugin)

bsorrentino commented 1 year ago

let me investigate

bsorrentino commented 1 year ago

Hi @BigMichi1

I've introduced a new option skipHtml on markdownProcessor parameter to handle your use case

Usage Example

 <configuration>
   <encoding>UTF-8</encoding>
   <failOnError>true</failOnError> 
  <siteDescriptor>${basedir}/src/site/confluence/issue284/site.yml</siteDescriptor>
  <markdownProcessor>
    <skipHtml>true</skipHtml><!-- 👀 -->
  </markdownProcessor>

</configuration>

I've deployed dev release 7.10-SNAPSHOT. Please, take chance to test it an let me know if it works as expected

BigMichi1 commented 1 year ago

thx, will test it tomorrow and report back

BigMichi1 commented 1 year ago

works perfectly, thank you so much

bsorrentino commented 1 year ago

Hi @BigMichi1 thank you for your valuable feedback and test

bsorrentino commented 1 year ago

feature released in version 7.10