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

This widget could not be displayed.
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.

This widget could not be displayed.
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 Monday in Confluence

Why start from scratch? Introducing four new templates for Confluence Cloud

Hi my Community friends!  For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...

361 views 2 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