Why when I add html code in a HTML macro can I then not edit the page?
Asked by Richard:

I have a page with text and one HTML macro.

Without the macro the page is fine.

If I place HTML code into the Macro, I can save and it display correctly and works as expected - however if I then go to EDIT the page I get a message telling me the page doesnt exist or I do not have permission to change it.

The page does exist, and I do have access to change it...it only seems to screw up when I add the code....

Below is the code - its a widget from [DESK.com](http://DESK.com) (our helpdesk).

```
&lt;!--If you already have jquery on the page you don't need to insert this script tag--&gt;&lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt;&lt;link href="https://d3jyn100am7dxp.cloudfront.net/assets/widget_embed_191.cssgz?1369806731" media="screen" rel="stylesheet" type="text/css" /&gt;&lt;!--If you already have fancybox on the page this script tag should be omitted--&gt;&lt;script src="https://d3jyn100am7dxp.cloudfront.net/assets/widget_embed_libraries_191.jsgz?1369806731" type="text/javascript"&gt;&lt;/script&gt;                        &lt;script&gt;                                                                // ********************************************************************************                                // This needs to be placed in the document body where you want the widget to render                                // ********************************************************************************                                                                new DESK.Widget({                                         version: 1,                                         site: 'altodigital.desk.com',                                         port: '80',                                         type: 'email',                                         displayMode: 1,  //0 for popup, 1 for lightbox                                        features: {                                          },                                          fields: {                                                 ticket: {                                                         // desc: &amp;#x27;&amp;#x27;,                                // labels_new: &amp;#x27;&amp;#x27;,                                // priority: &amp;#x27;&amp;#x27;,                                // subject: &amp;#x27;&amp;#x27;,                                // custom_system: &amp;#x27;&amp;#x27;,                                // custom_due_date: &amp;#x27;&amp;#x27;,                                // custom_type_of_issue: &amp;#x27;&amp;#x27;                                                },                                                 interaction: {                                                         // email: &amp;#x27;&amp;#x27;,                                // name: &amp;#x27;&amp;#x27;                                                },                                                 email: {                                                         //subject: '',                                                         //body: ''                                                 },                                                 customer: {                                                         // company: &amp;#x27;&amp;#x27;,                                // desc: &amp;#x27;&amp;#x27;,                                // first_name: &amp;#x27;&amp;#x27;,                                // last_name: &amp;#x27;&amp;#x27;,                                // locale_code: &amp;#x27;&amp;#x27;,                                // title: &amp;#x27;&amp;#x27;                                                }                                         }                                 }).render();                          &lt;/script&gt;
```


Answers:
author: Richard
body: Ok it seems you have to surround the text in the HTML macro in HTML tags - I assumed that was what the Macro would be doing....

<br />

Never mind all sorted now.


author: Richard
body: Have also tried placing the code in an external HTML file and using the HTML Includes macro to display it. While it does render properly, if I go to 'edit' it, it just acts like its loading the edit page but nothing ever displays.

It must be to do with the above code causing a conflict when in edit mode but not sure what exactly.


Tags: confluence-administration