The Style macro seems to remove Aboslute URLs from TOC. How can this be fixed?
Asked by Charles Gigante:

When using both the **Style** macro and the **Table of Contents** macro on a Confluence page, the TOC's "Absolute URL" does not function.

**Steps to reproduce:**

1. Create a new Confluence page
2. Add a **Table of Contents** macro
3. Edit 'Table of Contents' Macro \> Check the "**Aboslute URL**" checkbox
4. Insert a **Style** macro in the page
5. Add **Header** text somewhere on the page
6. **Save** the page
7. Click on any link in the Table of Contents
8. Check the browser URL

**Expected Result:**

The Confluence page URL is appended with an #anchorName that corresponds with the TOC link clicked on

**Actual Result:**

The page URL is **not** appended with a #anchorName.

**Note:** If the Style macro is deleted from the page, the Absolute URLs begin to function.

**Question:**

Does anyone have a decent workaround for this?


Answers:
author: Shannon S
body: Hi Charles,

Happy to help sort out this issue.

Can you tell me what version of Confluence you are using? If you're using Confluence Cloud, could you let me know if this is the old editor or the new editor? The new editor has the publish button in the top-right hand corner.

Lastly, do you have any particular customizations in your style macro or does it not work by default?

Regards,

Shannon

comments: author: Charles Gigante
body: Hi Shannon,

I must be using the old editor, since the Publish button is at the bottom right of the screen.

There are no particular customizations in the Style macro that seem to be causing this. Even an empty Style macro, if present, will cause this bug with the TOC.

Per the "About Confluence" modal:

#### About Confluence {#toc-hId--709851999}

![Confluence Logo](https://ringdna.atlassian.net/wiki/images/logo/confluence_header.svg)

License Information for Confluence Cloud {#toc-hId-1076596256}
--------------------------------------------------------------

### Confluence 1000.0.0-a8bb0fae4d4 {#toc-hId-1767157730}

Copyright ? 2003 - 2017 Atlassian Corporation Pty Ltd.

The use of this product is subject to the terms of the [Atlassian End User Agreement](http://www.atlassian.com/end-user-agreement), unless otherwise specified therein.

This product includes software developed by the [Apache Software Foundation](http://www.apache.org/).

This product includes software developed by [Twitter](https://github.com/twitter/twemoji), licensed under [CC-BY 4.0](https://creativecommons.org/licenses/by/4.0/)

This product also includes the following libraries which are covered by the GNU LGPL license:

* tinymce-3.4.9-atlassian-11, [LGPL 2.1](http://tinymce.moxiecode.com/license), [Source](https://ringdna.atlassian.net/wiki/s/-1685839142/6452/a8bb0fae4d4f80282d1b1615dcb086e1ce6142f9/1000.0.0-a8bb0fae4d4/_/download/resources/com.atlassian.plugins.tinymce:atlassian-rte-javascript-tinymce-core/tinymce.js)
* tinymce-4, [LGPL 2.1](http://tinymce.moxiecode.com/license), [Source](https://ringdna.atlassian.net/wiki/s/-1685839142/6452/a8bb0fae4d4f80282d1b1615dcb086e1ce6142f9/1000.0.0-a8bb0fae4d4/_/download/resources/com.atlassian.plugins.tinymce:atlassian-editor-tinymce-4-source/tinymce-4.js)

This product also includes code written by other third parties.

Additional details regarding these and other third party code included in this product, including applicable copyright, legal and licensing notices, are available in the "licenses" directory under the Confluence installation directory.

License Information for Confluence Cloud Plugins {#toc-hId-1756654626}
----------------------------------------------------------------------


author: Shannon S
body: Charles,

Thank you for confirming. I think this could be related to this bug:

* [CONFCLOUD-58655](https://jira.atlassian.com/browse/CONFCLOUD-58655) *Links in ToC do not work if text is Non-Latin and has applied CSS styling*

When you click on the links in the Table of Contents (without copying/pasting or trying to open them in a new tab) what happens? Does nothing happen, like in the description? When you copy the link, it's just a link to the page w/ no anchor attribute?

Regards,

Shannon


author: Charles Gigante
body: Hi Shannon,

When I click on the link in the TOC, it brings me to the correct anchor location in the page. However, the browser URL is not appended with the #anchor.

If I right-click on the TOC link and copy it, I get a long string. Here is an example of the string I copy from a TOC link when a Style macro is saved on the page.

The **bolded** text is the Page Title. The ***Underlined/Italicized*** text is the TOC link name.
> [https://ringdna.atlassian.net/wiki/content-only/viewpage.action?pageId=439256086\&iframeId=fallback-mode\&xdm_e=https://ringdna.atlassian.net/\&xsm_c=fallback-mode-fake-key__8745365813726282\&cp=/wiki\&cv=0.0.0-fallback-mode\&lic=none#](https://ringdna.atlassian.net/wiki/content-only/viewpage.action?pageId=439256086&iframeId=fallback-mode&xdm_e=https://ringdna.atlassian.net/&xsm_c=fallback-mode-fake-key__8745365813726282&cp=/wiki&cv=0.0.0-fallback-mode&lic=none#)**PRDComponents/Styling** -*++Samples++*


author: Shannon S
body: Hello Charles,

My apologies for the long delay. I've reported this as a bug below:

* [CONFCLOUD-67766](https://jira.atlassian.com/browse/CONFCLOUD-67766) *Style macro removes absolute links from Table of Contents*

I wanted to be open with you and let you know that [in the New Editor](https://confluence.atlassian.com/confcloud/confluence-editing-improvements-945107733.html), the Style Macro has been discontinued. See [We're cleaning up the macro browser](https://confluence.atlassian.com/confcloud/we-re-cleaning-up-the-macro-browser-946028471.html) for more details under **Other macros being deprecated**. Therefore, it's not likely that this bug will be fixed before the new editor is completely rolled out.

Thank you again for your understanding.

Regards,

Shannon


Tags: macro

style

table-of-contents