Closed OnceUponALoop closed 1 month ago
I tried just defining the html manually, that seems to break due to the <p>
incorrectly wrapping the ac
instead of the table
<!-- Space: ~0123456 -->
<!-- Parent: Test -->
<!-- Title: Testing Mark -->
<ac:structured-macro ac:name="details" ac:schema-version="1">
<ac:rich-text-body><table>
<thead>
<tr>
<th>Key1</th>
<th>Key2</th>
</tr>
</thead>
<tbody>
<tr>
<td>Value1</td>
<td>Value2</td>
</tr>
</tbody>
</table>
</ac:rich-text-body>
</ac:structured-macro>
TRACE
2024-07-15 18:20:09.558 TRACE rendering markdown:
<ac:structured-macro ac:name="details" ac:schema-version="1">
<ac:rich-text-body><table>
<thead>
<tr>
<th>Key1</th>
<th>Key2</th>
</tr>
</thead>
<tbody>
<tr>
<td>Value1</td>
<td>Value2</td>
</tr>
</tbody>
</table>
</ac:rich-text-body>
</ac:structured-macro>
2024-07-15 18:20:09.559 TRACE rendered markdown to html:
<p><ac:structured-macro ac:name="details" ac:schema-version="1">
<ac:rich-text-body><table></p>
<thead>
<tr>
<th>Key1</th>
<th>Key2</th>
</tr>
</thead>
<tbody>
<tr>
<td>Value1</td>
<td>Value2</td>
</tr>
</tbody>
</table>
</ac:rich-text-body>
</ac:structured-macro>
If I take my table and make it a one-line it works. Here the <p>
surrounds the whole thing.
<ac:structured-macro ac:name="details" ac:schema-version="1">
<ac:rich-text-body><table><thead><tr><th>Key1</th><th>Key2</th></tr></thead><tbody><tr><td>Value1</td><td>Value2</td></tr></tbody></table>
</ac:rich-text-body>
</ac:structured-macro>
TRACE
2024-07-15 18:25:01.143 TRACE rendering markdown:
<ac:structured-macro ac:name="details" ac:schema-version="1">
<ac:rich-text-body><table><thead><tr><th>Key1</th><th>Key2</th></tr></thead><tbody><tr><td>Value1</td><td>Value2</td></tr></tbody></table>
</ac:rich-text-body>
</ac:structured-macro>
2024-07-15 18:25:01.144 TRACE rendered markdown to html:
<p><ac:structured-macro ac:name="details" ac:schema-version="1">
<ac:rich-text-body><table><thead><tr><th>Key1</th><th>Key2</th></tr></thead><tbody><tr><td>Value1</td><td>Value2</td></tr></tbody></table>
</ac:rich-text-body>
</ac:structured-macro></p>
Yes that unfortunately doesn't work right now. See also: https://github.com/kovetskiy/mark/issues/324
Btw I rebuilt it after removing the syntax error (here) but the behavior remained the same.
Like you I looked into block parsing but couldn't get it to work properly. I ran it through the debugger for a while and finally gave up, waiting for someone smarter to dust it off :|
Good catch! Quoting is fixed in 9.13.1. Feel free to give it a shot.
Please test with https://github.com/kovetskiy/mark/releases/tag/10.0.0 and report back if it's still not working as expected.
Can confirm - working as expected now :clap:
024-08-01 12:10:51.432 TRACE rendering markdown:
<ac:structured-macro ac:name="details" ac:schema-version="1"><ac:rich-text-body>
| Key1 | Key2 |
| --- | --- |
| Value1 | Value 2 |
</ac:rich-text-body></ac:structured-macro>
2024-08-01 12:10:51.433 TRACE rendered markdown to html:
<ac:structured-macro ac:name="details" ac:schema-version="1"><ac:rich-text-body>
<table>
<thead>
<tr>
<th>Key1</th>
<th>Key2</th>
</tr>
</thead>
<tbody>
<tr>
<td>Value1</td>
<td>Value 2</td>
</tr>
</tbody>
</table>
</ac:rich-text-body></ac:structured-macro>
What happened?
I'm trying to use the
ac:details
template to populate page properties but i'm unable to due to errors in parsing.com.atlassian.confluence.api.service.exceptions.BadRequestException: Content body cannot be converted to new editor format
What did you expect to happen?
I expected a page properties element with a table of key value pairs
How can we reproduce the behavior you experienced?
Using the following example
Further Information (please complete the following information)
mark --version
): v9.12.0Logs or other output
Markdown parsing section of the log
Additional context
I'm unclear if my
ac:details
usage is correct.Looking at the code it seems there's an extra
"
in the<ac:structured-macro ac:name="details" ac:schema-version="1"">
line (here) but i'm unsure if that's the cause of my problem.I don't currently have a golang build env otherwise I would test fixing it myself