Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,300,847
Community Members
 
Community Events
165
Community Groups

Why does Confluence use class="auto-cursor-target"

Bill Bailey Community Leader Jun 27, 2019

This is more of a curiosity.

I often have to edit the storage code for a page to clean up various items. I noticed awhile back that the following code would appear, I guess as a spacer around some objects?

 <p class="auto-cursor-target">
     <br/>
</p>

It seems the be filtered out when the page is displayed. Does anyone know why Confluence is inserting this code?

 

3 answers

I believe it has something to do with collaborative editing as I have only seen that when Synchrony is turned on.

Bill Bailey Community Leader Jun 27, 2019

That could be. I know I can delete them, but they are reinserted. The only reason I care is it creates extra phantom space in the editor view that causes me to think it is empty p tags or something like this:

<p>
     <br/>
</p

You can manually edit the HTML, get rid of the auto-cursor-target and add a <span></span> instead. 

Directly save the page and don't touch or edit it again ant the <br> is gone. We use this for example for pages that we include in other pages.

This will not help everyone but at least it works :-)

This was helpful because after replacing <p class="auto-cursor-target"> <br/></p> with <span></span>, I saw what auto-cursor-target was doing. It managed the space between macro elements, in my case the structured macro element for an ac=info element.

Actually, without auto-cursor-target I got a full paragraph height of white space after a note, so when I had consecutive notes it didn't look good. With auto-cursor-target the white space following the note was reduced, which looked much better. This works for all sorts of elements it seems, like checklists. 

I'd wondered why I sometimes had a lot and sometimes a little white space after these macro elements. Now I know that when I want the standard paragraph white space following, I'll check that I have <span></span> in the code, and when I want reduced white space following, I'll make sure that I have the auto-cursor-target paragraph. Great find! Thank you.

Like s-jparker likes this

auto-cursor-target is like a virus. Once it gets into your page is messes up the formatting and it is very hard to get rid of

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

An update on Confluence Cloud customer feedback – June 2022

Hi everyone, We’re always looking at how to improve Confluence and customer feedback plays an important role in making sure we're investing in the areas that will bring the most value to the most c...

388 views 2 13
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you