Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignore markdown-lint tags when publishing pages #284

Closed
BigMichi1 opened this issue Feb 27, 2023 · 9 comments
Closed

ignore markdown-lint tags when publishing pages #284

BigMichi1 opened this issue Feb 27, 2023 · 9 comments
Assignees

Comments

@BigMichi1
Copy link

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 bsorrentino added the discussion start discussion about issue label Feb 27, 2023
@bsorrentino
Copy link
Owner

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
Copy link
Author

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
Copy link
Author

BigMichi1 commented Feb 27, 2023

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
Copy link
Owner

let me investigate

@bsorrentino bsorrentino self-assigned this Feb 27, 2023
@bsorrentino bsorrentino added under working and removed under verification discussion start discussion about issue labels Mar 1, 2023
bsorrentino pushed a commit that referenced this issue Mar 1, 2023
@bsorrentino
Copy link
Owner

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
Copy link
Author

thx, will test it tomorrow and report back

@BigMichi1
Copy link
Author

works perfectly, thank you so much

@bsorrentino
Copy link
Owner

Hi @BigMichi1 thank you for your valuable feedback and test

@bsorrentino
Copy link
Owner

feature released in version 7.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants