I am creating a DIV macro that will allow users to place custom <div> tags and place content within the div.
I tested with an iframe and i noticed that there are extraneous tags being displayed as plain text after the iframe.
I'm just basing this test on the "collapse" macro from this page: https://confluence.atlassian.com/conf73/writing-user-macros-991928530.html
I'm putting the HTML macro with my iframe within my DIV macro.
This is what the rendered page looks like. The iframe is correctly inside my div container, but there is an extra "</div>" printed after the iframe
Looking at the page source, the </div> is both in the html as expected but also in some text after the iframe.
This becomes even more of a problem if you have nested div macros or tables, it seems to print out any closing tags after the iframe.
I've tested with a few other websites in the iframe with similar results.
Why are you nesting a HTML macro inside the body of the macro? I would just structure the macro so that all the HTML is inside the user macro, and then you can either have body hold the src link, or even make it a parameter with no macro body. Then use the parameters in your code.
I would also make the width and height parameters to make it more configurable.
If you need the HTML macro, then move that instance to inside the user macro. Take a look at this article I wrote awhile back on wrapping a macro: Getting Started with User Macros - Writing a Wrapper Macro
Thanks for the info Bill, I'll take a look at your article.
The original intent was to have a generic div macro that could include any content like text or other macros. This would help tie in with custom stylesheets and being able to style elements with a surrounding div id/class.
Are there known issues with nested macros?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think the issue with nested macros is unpredictability with the rendered output. I have always gone the route or wrapping a macro if needed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I see. Yeah I've been trying to generalize macros as best i can and then nest any existing macros inside, but like you said I've also ran into some strange cases of the output not behaving as expected.
I'll try making a simple iframe specific macro and see if that has any similar issues.
For the most part, I haven't had issues with the nested div macros in my post. But seems to be something with how the iframe is processed in conjunction with the macro.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Putting the iframe directly in the macro (not using the nested html macro):
<div><iframe>...</iframe></div> still has the issue
Putting just the iframe in the macro seems to work fine.
I will just create an iframe macro and expose some paramters.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.