-
Notifications
You must be signed in to change notification settings - Fork 28
Wrong escaping of CDATA #109
Comments
Jumping into
|
Hmm, thanks. I guess this is basically because This Rmd (conflr uses commonmark variant) ---
output:
md_document:
variant: commonmark
---
<ac:rich-text-body><![CDATA[<p>foo</p>]]></ac:rich-text-body> will be knitted to this: <ac:rich-text-body><![CDATA[<p>foo
</p>
\]\]\></ac:rich-text-body> |
Oh, I see -- thank you! Interesting, as Anyway, do you know about any workaround passing arbitrary text in a macro using |
Wow! Sorry, then I simply misunderstood the spec... Hmm, I don't come up with any workaround at the moment. |
One problem is that commonmark::markdown_commonmark("<ac:rich-text-body><![CDATA[<p>foo</p>]]></ac:rich-text-body>")
#> [1] "<ac:rich-text-body><![CDATA[<p>foo</p>]]>\\</ac:rich-text-body\\>\n"
commonmark::markdown_commonmark("<ac-rich-text-body><![CDATA[<p>foo</p>]]></ac-rich-text-body>")
#> [1] "<ac-rich-text-body><![CDATA[<p>foo</p>]]></ac-rich-text-body>\n" Created on 2020-05-30 by the reprex package (v0.3.0) But, this doesn't actually solve the problem. I have no idea what's happening here. |
Thanks for looking into this further. I also spent some time on this, and found that the problem for the tag mismatch is that something in the middle of the flow adds
Will be rendered in
Which is OK, but if I peek into
So something adding the Any thoughts on what's causing that? Interestingly, using eg
And this actually get pushed to Confluence and renders as foo! there without any issue. |
The problem is I think that |
Well, now I think I know that's the root problem:
Sorry for the many messages here 🤦 I will let you know if I find a solution to this problem -- not really related to |
A pandoc expert told me that we can use raw attribute here. Could you try this? ---
title: "test page"
output:
conflr::confluence_document:
space_key: "***"
---
<ac:structured-macro ac:name="expand">
<ac:parameter ac:name="title">hidden stuff below</ac:parameter>
<ac:rich-text-body>`<![CDATA[<p>foo</p>]]>`{=html}</ac:rich-text-body>
</ac:structured-macro> |
You can also treat the whole block as raw HTML.
|
Thanks @atusy! |
Awesome, thank you very much to both @yutannihilation and @atusy 🙇 FTR this is a bit more complex example on what I tried to achieve (someone might find this useful):
Resulting in: Also, closing the ticket as no need for |
Phew, pretty complex! Glad that you find that way, thanks for sharing. conflr might eventually support |
Example document:
Note the
CDATA
section for passing in HTML.This fails with:
And renders a markdown file as:
Note that the closing tag of the
CDATA
is somehow got escaped.Not sure what's causing the problem, as
conflr:::restore_cdata
seems to match it and run correctly (after patching to work withrich-text-body
as well besidesplain-text-body
), but some other mechanism might mess up the closing CDATA tag later on in the process?The text was updated successfully, but these errors were encountered: