Duplicate rendering for content outside of <a> in inline template snippet

I’m using a SnTitleLink to display inline template links to my File content type. I’m using the built-in attachment size and extension to change the anchor class and display the filesize next to the link. If I display the filesize outside of the <anchor> tag it renders twice; once upon inserting the template in the Ephox editor and again when previewing.

Snippet code (I build the span for the filesize and set it $displaysize in the snippet code):


#set($displaysize = " <span class='filesize'>(" + $formattedsize + "Kb)</span>")
<a href="$pagelink" $class>${displaytitle}</a>${displaysize}##

When previewing my content I see:
<anchor href=“linktofile.pdf” class=“pdf”>Name of File [pdf icon]</anchor> <span class=“filesize”>(89Kb)</span><span class=“filesize”>(89Kb)</span>

I do notice that when I add the inline template in the Ephox editor it auto renders the value of $displaysize next to the link. If I delete that, in this example the (89Kb), the page renders fine with the filesize showing up just once.

<anchor href=“linktofile.pdf” class=“pdf”>Name of File [pdf icon]</anchor> <span class=“filesize”>(89Kb)</span>

Also, if I modify the snippet to display the filesize within the anchor tag it displays once, leading me to believe that items outside the anchor tag are rendered twice (once upon entry into Ephox, then again when previewing?).

How can I modify my snippet template to render the file size just once, outside of the anchor tag?

Thanks,
John