-
Notifications
You must be signed in to change notification settings - Fork 144
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
Table within macro is not rendered #324
Comments
I believe the problem is that we're treating ac:foo </ac:foo> as an inline instead of a block item in https://github.com/kovetskiy/mark/blob/master/pkg/mark/parser/confluencetags.go |
@bernd (you might have some thoughts here as you added #270) @kovetskiy any thoughts on how to achieve this? |
@mrueg Can you share your block parser code? |
@bernd mrueg@e409fb7 this was my attempt but it does not work, as the closing ones after the table will create a new paragraph. I'm not sure if I need to use a paragraph transformer for that. |
@mrueg I spent a little time looking at this - I'm not sure if the inline parser is the issue. It looks like the FWIW, I think that actually may be a legit rendering of that markdown - GFM tables, I think, need to start their line. If you put a e.g. versus <ac:structured-macro ac:name="info">
</ac:rich-text-body> (the above being your original example verbatim in a Github comment) |
Thanks for taking a look, I made a mistake in the initial description, hope this makes it more clear: The problem is that the RawHTML gets encapsulated in a paragraph
then the table follows and the closing tags are encapsulated in its own paragraph.
|
A similar example which I think shows some inconsistency in how inline macros work. There are two pairs of macros, the first is the tblbox macro from the project's README and the second is my attempt to create an infobox macro. <!-- Space: space -->
<!-- Parent: parent -->
<!-- Title: title -->
<!-- Macro: <tblbox\s+(.*?)\s*>
Template: #inline
title: ${1}
inline: |
<table>
<thead><tr><th>{{ .title }}</th></tr></thead>
<tbody><tr><td>
-->
<!-- Macro: </tblbox>
Template: #also_inline
also_inline: |
</td></tr></tbody></table>
-->
<!-- Macro: <infobox\s+(.*?)\s*>
Template: #inline
title: ${1}
inline: |
<ac:structured-macro ac:name="info" ac:schema-version="1">
<ac:parameter ac:name="title">{{ .title }}</ac:parameter>
<ac:rich-text-body>
-->
<!-- Macro: </infobox>
Template: #also_inline
also_inline: |
</ac:rich-text-body></ac:structured-macro>
-->
<tblbox with a title>
and some
content
</tblbox>
<infobox info title>
and some
content
</infobox> Which when rendered produces... <table>
<thead><tr><th>with a title</th></tr></thead>
<tbody><tr><td>
<p>and some
content</p>
</td></tr></tbody></table>
<p><ac:structured-macro ac:name="info" ac:schema-version="1">
<ac:parameter ac:name="title">info title</ac:parameter>
<ac:rich-text-body></p>
<p>and some
content
</ac:rich-text-body></ac:structured-macro></p> So |
I'm struggling with the same problem. Does anybody have a solution for using |
What happened?
Trying to render this to confluence
results in
What did you expect to happen?
Table gets rendered
How can we reproduce the behavior you experienced?
Steps to reproduce the behavior:
In case this is related to specific markdown, please provide a minimal markdown example here.
** Information (please complete the following information):**
mark --version
): [e.g. v9.1.4] 9.5.2** Logs or other output**
Please provide logs, other kind of output or observed metrics here.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: