How to remove em dash from Content by Label macro output?

Kim Wallace June 3, 2021

I'm looking to remove the em dash that precedes the page excerpt in my content by label macro output.

I've added CSS to

  • remove the icon
  • put the page title and excerpt on separate lines

When I look at the page in HTML I see that em dash is enclosed with the excerpt content. How does it get there and how can I remove it?

Goal appearance is:

Page title

Excerpt text below.

1 answer

0 votes
Thiago Masutti
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 3, 2021

Hi @Kim Wallace 

The '-' character is part of the Content by Label Macro output to separate the title and the page excerpt.

You might be able to remove the dash by using the following JavaScript code within an HTML macro in the same page.

<script type="text/javascript">
AJS.toInit(function(){
AJS.$('ul.content-by-label.conf-macro.output-block > li > div.details > span.smalltext').each(function(){
if($( this ).text().startsWith('— ')){
var currentText = $( this ).html();
$( this ).html(currentText.substring(2));
}
});
});
</script>

 

I hope  that helps.

Kind regards,
Thiago Masutti

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events