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
publishToConfluence: Error rendering macro 'code' #402
Comments
can you please retry and use ActionScript, AppleScript, Bash, C#, C++, CSS, ColdFusion, Delphi, Diff, Erlang, Groovy, HTML and XML, Java, Java FX, JavaScript, PHP, Perl, Plain Text, PowerShell, Python, Ruby, SQL, Sass, Scala, Visual Basic I guess |
bash and powershell works fine! Will look what match in the future. Maybe you should add this restriction to the documentation? Find here that it is possible to add further languages : |
Thanks a lot @tkleiber This makes that error disappear. But now the json looks like this Is there a way to make it look like a formatted json ? |
The error now happens with bash and powershell too in doctoolchain 2.2.1! |
so, do I understand this correct that the problem is that confluence does not understand some of the syntaxt highlighting languages which are supported by asciidoc? The code-block-macro and the valid languages are described here: https://confluence.atlassian.com/doc/code-block-macro-139390.html The code in doctoolchain which tries to match asciidoc sntax highlighting with with confluence code blocks can be found here: https://github.com/docToolchain/docToolchain/blob/ng/scripts/asciidoc2confluence.groovy#L466 As I can see, there are already some rules defined. Which rules do we miss? |
After upgrading to version 2.2.1 already existing rules for bash and powershell does not work anymore. |
Six month ago, we changes the logic: https://github.com/docToolchain/docToolchain/blame/6e376b522d34cdb29814d33a4babe76382ec4106/scripts/asciidoc2confluence.groovy#L461 Can you see if a version from more than six month ago works for you? Can you post the header of your asciidoc code block and the converted macro from confluence here? You can view the marco in conflzence by taking a look at the "storage format view" (I think this is what it is named in the right hand menu of a page) |
Already told - 2.1.0 is working. View Source code of the browser (Edge) shows:
"View Source" in the confluence page shows (Description of the image as I cannot upload one here): Code Block | language = bash |
thanx. I now had some more time to check this problem. I use the following AsciiDoc source .some code
[source, bash]
----
curl dtcw
chmod +x dtcw
----
And publish it to confluence (cloud instance) and it is correctly rendered as Interestingly, my confluence says the code is rendered as "Shell" where your error massage says "bash"
what is different to your setup? |
The problem exist for header deeper than second level in combination with the configuration parameter subpagesForSections = 2 and docToolchain 2.2.1.
The code block from second level header is rendered fine, the code block from the third level header (generated in the sub page) gives the error. The same code renders both code blocks fine with configuration parameters createSubpages = true and allInOnePage = false and docToolchain 2.1.0. Off topic: Why I can not upload screenshots here? |
i can confirm that this is a problem in all "depper" sections than 2. Is there a known workaround instead of going back (we have a very large document where we need 3-4)? For us it will be a show stopper. We already spend one day to find the issue, but without success. Confluence 7.19.0 . |
So, the first source renders as
or nicely formatted
The second one as
So, the main difference is that the second one is formatted and that there are line breaks around the "language" argument. |
So, it seems that the bug is in this line: https://github.com/docToolchain/docToolchain/blob/ng/scripts/asciidoc2confluence.groovy#L528 Seems to be a bug or unknown feature in the jsoup library. I will prepare a workaround. |
created a PR with the workaround. Do you know how you can instantly give this PR a try? |
Should be now available if you use version "latest" |
Latest version on Github is from march and is version 2.2.1, where the error happens! So what do you mean with latest - do mean 3.0.0-rc1? |
dtcw lets you use "latest" as version which will clone the repository. This works with a local install. |
Last time I tried to dowload dtcw behind our corporate network I was not succesful. |
Describe the bug
Publish works, but contained code blocks:
are not generated. Instead on the Confluence page following is shown:
To Reproduce
Expected behavior
Code should be shown formatted in Confluence like in HTML or PDF
Screenshots
If applicable, add screenshots to help explain your problem.
Configuration
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: