Overriding confluence editor behavior

  • Is there a way to override the confluence editor behavior of taking care of formatting by itself. Like , for example confluence will automatically convert a text to h1 heading if its preceded by h1. followed by space. There is a way to stop this by starting with {{ for the text you dont want formatting to apply
    followed by }} , but this doesnt apply for multi-lines, so the user has to enter two closing braces for every line for which he wants to skip formatting.

    Any way out to make the confluence editor stop doing this for Confluence version 5.3?

2 answers

1 accepted

1 vote
Accepted answer
Steven Behnke Community Champion Feb 09, 2015

So, Confluence handles text like this on purpose. The issue here is that lots of users are used to editors like Microsoft Word, where every single dang bit of XML is individually styled. The World Wide Web just doesn't operate that way so when we start using an editor that works with REAL XML, we need to treat the "web document" as if we were creating a website, which means we NEED to adhere standards. This means that text should be in paragraph tags, styling should be done through CSS, etc.

Now, what's happening when you turn text into Heading 1 is that you are indicating that this text is a title. It wraps the "title content" in the HTML tags:

<h1>Title content goes here</h1>

When you type a " " (space) you aren't leaving the H1 (or h2, h3, h4, h5, etc) tags, you're still "inside" the heading. The ONLY way to break out of that heading is to do a Hard Return which you do by pressing Enter (or Return) on your keyboard. This places you in a new set of <p> (paragraph) tags. Doing a Soft Return (Shift+Enter) also WILL NOT break you out of a heading: It simply inserts a line-break, or more specifically: 

<br />

What am I trying to say? What you are asking really isn't possible because of the way Confluence works. What you DO want is the ability to set "font-size" arbitrarily. I haven't seen an add-on for that anywhere and Atlassian is going to avoid it because they make documentation and have no need for setting font sizes outside of headings.

You could possibly achieve this with a User Macro, if you wanted to check that out.

0 votes
Steven Behnke Community Champion Feb 09, 2015

If you want a user macro that let's you set font-size inline, you can try this out: 

## Macro Name: Font Size
## This macro adjusts font-size based on user choice.
## Developed by: steve behnke [blackpearl pdm]
## @param Size:title=Font Size|type=enum|enumValues=8px,10px,12px,14px,16px,18px,20px,24px,32px,48px,72px|required=true|desc=Choose a font-size (px)
## @param Content:title=Text|type=string|required=true
&lt;span style="font-size: $paramSize;"&gt;$paramContent&lt;/span&gt;

You can't use the Macro Body option because Confluence won't let macros with a body be inline. You must capture the input via a parameter.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Feb 06, 2019 in Confluence

Try out the new editing experience

Hi team, I’m Avinoam, a product manager on Confluence Cloud, and today I’m really excited to let the Community know that all customers can now try out the new editing experience and see some of the ...

808 views 38 5
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you