Why is user profile macro being picked up in TOC?
Asked by Kellie Finch:

We've run into a weird issue where when adding a user profile macro on a page, that user's name appears in the table of contents macro. It doesn't appear this way when you preview the whole page, but it does appear in the preview for the macro and appears whenever you publish the page. The only workaround I've found for now is to set the max heading level to 3, headings 4-7 still show the user profile.

Anybody know what the issue is and/or how to fix it?


Answers:
author: Kristian Klima
body: Hi [@Kellie Finch](/t5/user/viewprofilepage/user-id/4813767)

Just to elaborate on [@Laurie Sciutti](/t5/user/viewprofilepage/user-id/1137433) 's correct answer...

Sometimes, HTML in Confluence Server can get pretty muddled up. So elements of text or macros may end up in format container.

Setting your element to a different format/style may, in turn, result in the change being applied to larger chunks of text.

To be on the safe side when facing style/formatting issues, select the offending section, from the formatting menu select Clear formatting. This clears the HTML. Then apply the formatting/style that you want.

comments: author: Thomas Gericke
body: Hi [@Kristian Klima](/t5/user/viewprofilepage/user-id/5074962)

[@Laurie Sciutti](/t5/user/viewprofilepage/user-id/1137433) 's answer is neither correct nor helpful. What [@Kellie Finch](/t5/user/viewprofilepage/user-id/4813767) wrote is absolutely true and pretty annoying. Also, there's a [Bug Report from 2017](https://jira.atlassian.com/browse/CONFSERVER-46234) which is classified as ++*Suggestion*++ and not nearly solved.

Did you even read or check out the actual problem? Because it's pretty obvious and setting the macro to "Paragraph" doesn't change anything.

It's so annoying.


author: Kellie Finch
body: Thanks for the issue link! I voted on it, but I doubt it will get resolved anytime soon if ever even though it's a relatively simple request.


author: Laurie Sciutti
body: Just to elaborate a bit, I've run into similar issues and clearing the formatting around the macro absolutely solved my issues, which is why I provided my initial "answer". Keep in mind that I am not familiar with your environment, just providing a suggestion based on the information provided. So, [@Thomas Gericke](/t5/user/viewprofilepage/user-id/4600952), my "answer" may not have **helped** in this situation but people looking at this post down the line may actually find it **useful** . [@Kellie Finch](/t5/user/viewprofilepage/user-id/4813767) \~ sorry this didn't solve your issue. Hope you find a resolution soon.


author: Laurie Sciutti
body: Hi [@Kellie Finch](/t5/user/viewprofilepage/user-id/4813767) \~ click the macro itself and make sure the format is set to "Paragraph".


author: Kellie Finch
body: [@Kristian Klima](/t5/user/viewprofilepage/user-id/5074962) [@Laurie Sciutti](/t5/user/viewprofilepage/user-id/1137433) I tried to change the formatting to paragraph, I even tried clearing formatting, I also tried this on test pages with the toc and user profile in separate sections with nothing else but those macros in the page, so no other headings or formatting could affect it, so I don't think it's a heading or formatting issue. Like I said, even when I would change the toc parameters of the max heading level, the user profile would still show up in the table of contents until it was changed to 3.

I did just inspect the user profile macro though, and it does seem to be giving it a heading 4 tag, which would explain why the toc max heading level needed to be changed to 3, but now the mystery is why is the user profile automatically being tagged h4?


Tags: confluence-server

macro

profile

server

table-of-contents