Mediawiki sections translated as headers except title sections (was: UWC header parser not translating Mediawiki headers correctly)

EDIT: these aren't headers, they are sections. See:

However, the UWC is translating them as headers (a good thing if I can get it to recognize title sections!)


The converter is working (after using the UWC exporter to create the files) except for one thing, only h2 and below headers are being converted. The syntax for h2 headers looks like this:

== Header 2 ==

This gets turned into a Confluence h1 tag ... so each header is pushed down a level and h1 isn't recognized. When I convert a file with "= Header 1 =" it is rendered as straight text:

= Header 1 =

Any ideas on how to fix this?

2 answers

1 accepted

0 votes
Answer accepted

I am clearly not a developer - I finally found where this translation is taking place. The regex was wrong and luckily I have developers that can correct these types of things. The resulting regex was:[^=]?=\s*(.*?)\s*=(?!([=])){replace-with}h1. $1

instead of^|\n)={1}([^=]+)={1}(\n|$){replace-with}h1. $1

Works like a charm now.

I also bumped all of the headings up one so that they go to h5.

I figured out that it is translating the Mediawiki sections into headers. The syntax described above looks like headers but is actually to define sections so that you can edit a specific section (or link to).

However, I can't find anywhere in the code that actually does this translation. I can only find where the headers are translated.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 12, 2019 in Confluence

Confluence Admin Certification now $150 for Community Members

More and more people are building their careers with Atlassian, and we want you to be at the front of this wave! Important Dates Start the Certification Prep Course by 2 April 2019 Take your e...

928 views 2 13
Read article

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