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

Improve xml source code blocks display #30

Open
TitouanM opened this issue Jul 5, 2024 · 9 comments
Open

Improve xml source code blocks display #30

TitouanM opened this issue Jul 5, 2024 · 9 comments

Comments

@TitouanM
Copy link

TitouanM commented Jul 5, 2024

Hello

In an adoc file, I have a block of code :

[source,xml]

< ?xml version="1.0" encoding="UTF-8"?>
< Personne>
< champ1>
< champ2>something cool< /champ2>
< /champ1>
< /Personne>

Is it possible to improve the rendering please ?

Actually, the rendering is :
& lt;?xml version="1.0" encoding="UTF-8"?& gt;
& lt;Personne& gt;
& lt;champ1& gt;
& lt;champ2>comething cool& lt;/champ2>
& lt;/champ1& gt;
& lt;/Personne& gt;

Thanks

@PacoVK
Copy link
Owner

PacoVK commented Jul 5, 2024

I assume you want to have a pretty formatted rendering here?

@TitouanM
Copy link
Author

TitouanM commented Jul 5, 2024

Whooops sorry the code blocks and the "& lt;" had been transformed by the editor ! I edited my first message !

@PacoVK
Copy link
Owner

PacoVK commented Jul 9, 2024

Thanks for bringing this up, i am working on a fix and will try to release soon :)

PacoVK added a commit that referenced this issue Jul 9, 2024
PacoVK added a commit that referenced this issue Jul 25, 2024
PacoVK added a commit that referenced this issue Jul 25, 2024
* improve overall conversion based on #30

* update yarn.lock

* update yarn.lock
@TitouanM
Copy link
Author

Thx a lot for your reactivity. Do you know when will be the next release please ?

@PacoVK
Copy link
Owner

PacoVK commented Jul 30, 2024

I just released 0.3.1 :)

@TitouanM
Copy link
Author

TitouanM commented Jul 30, 2024

I just tried the new release. I have a new issue but I don't know if you want a new ticket or just to continue here. Feel free to let me know ;)

In a page, I have a table :

== My table 
|===
|Header 1 | Header 2 | Header 3
|Item 1 |X |X
|Item 2 |  | X
|Item 3 |  | X

The HTML generation gives :

<h2 id="_mytable"><a class="anchor" href="#_mytable"></a>My Table</h2>
<div class="sectionbody">
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 33.3333%;">
<col style="width: 33.3333%;">
<col style="width: 33.3334%;">
</colgroup>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Header 1</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Header 2</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Header 3</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Item 1</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">X</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">X</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Item 2</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">X</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Item 3</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">X</p></td>
</tr>

</tbody>
</table>

In the end, the antora-confluence part leads to the following error :

warn:     Publish failed with response 400
warn:     {"statusCode":400,"data":{"authorized":false,"valid":true,"allowedInReadOnlyMode":true,"errors":[],"successful":false},"message":"Error parsing xhtml: Unexpected close tag </colgroup>; expected </col>.\n at [row,col {unknown-source}]: [21,440]","reason":"Bad Request"}
error: undefined
[16:14:07.443] FATAL (antora): Cannot destructure property 'id' of '(intermediate value)' as it is undefined.
    Cause: TypeError

Seems like it is waiting a but there is no need.

Can you have a look at it please ?

PacoVK added a commit that referenced this issue Jul 30, 2024
* fix bug of Improve xml source code blocks display #30

* update test
@PacoVK
Copy link
Owner

PacoVK commented Jul 30, 2024

Thanks for the quick feedback, unfortunately i oversaw that i was missing a setting to ensure closed tags. I just released 0.3.2 for that

@TitouanM
Copy link
Author

Thanks for your fast reaction !
Unfortunately, I have a new error with release 0.3.2 that I did not have in 0.3.0 :

Error parsing xhtml: Unexpected character '>' (code 62) in content after '<' (malformed start element?)

For the moment, I did'nt find the source of this error....

@PacoVK
Copy link
Owner

PacoVK commented Aug 15, 2024

@TitouanM i fail to reproduce it. So far i tried to reproduce with the following example:

= System Scope and Context
:plantuml-server-url: http://plantuml.com/plantuml

[.helptext]
****
.Contents
System scope and context - as the name suggests - delimits your system (i.e. your scope) from all its communication partners
(neighboring systems and users, i.e. the context of your system). It thereby specifies the external interfaces.

If necessary, differentiate the business context (domain specific inputs and outputs) from the technical context (channels, protocols, hardware).

.Motivation
The domain interfaces and technical interfaces to communication partners are among your system's most critical aspects. Make sure that you completely understand them.

.Form
Various options:

* Context diagrams
* Lists of communication partners and their interfaces.
****

== Business Context

[source,xml]
< ?xml version="1.0" encoding="UTF-8"?>
< Personne>
< champ1>
< champ2>something cooddd< /champ2>
< /champ1>
< /Personne>

[.helptext]
****
.Contents
Specification of *all* communication partners (users, IT-systems, ...) with explanations of domain specific inputs and outputs or interfaces.
Optionally you can add domain specific formats or communication protocols.

.Motivation
All stakeholders should understand which data are exchanged with the environment of the system.

.Form
All kinds of diagrams that show the system as a black box and specify the domain interfaces to communication partners.

Alternatively (or additionally) you can use a table.
The title of the table is the name of your system, the three columns contain the name of the communication partner, the inputs, and the outputs.
****

No error and it renders the XML nicely in my Confluence Cloud instance i have

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

No branches or pull requests

2 participants