Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Macro to replace tab with 4 spaces?

E September 2, 2012

If it possible to create a user macro that can replace a tab with 4 spaces?

The Codeblock macro has a bug that means tabs print as a single space, so I'm wondering if a macro could be created that would create a code block and then look at the text entered in the codeblock and replace the tabs with 4 spaces.

Is this possible? Any suggestions how?

1 answer

0 votes
CharlesH
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 3, 2012
I imagine the code block can be pinpointed easily, perhaps because it is a div with a certain class. In this case I would suggest trying to use jQuery to analyse the div content and replace the tab character with four non breaking space characters. JQuery is bundled with Confluence, so is easily used in user macros. String replacement example: http://www.jquery4u.com/dom-modification/replace-string-characters-javascript/

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, loom, loom for training, loom for teaching, video training, async learning, online education, screen recording, loom tutorials, loom use cases, atlassian learning, team training tools, instructional video, virtual training tools

🛗 Elevate Your Training and Enablement with Loom

Join us June 26, 11am PT for a webinar with Atlassian Champion Robert Hean & Loom’s Brittany Soinski. Hear tips, stories, and get your burning questions answered. Learn how Loom makes training and enablement easier. Don’t miss it!

Register today
AUG Leaders

Atlassian Community Events