What is the best way to format the code of a Fremarker macro containing embedded html code, used to implement the widget renderers?

Let's consider, for example:

<#macro renderFieldTitle style title><#if style?has_content><span class="${style}"></#if>${title}<#if style?has_content></span></#if></ #macro>

Should we try to format it to maximize its readibility? For example:

<#macro renderFieldTitle style title>
    <#if style?has_content>
        <span class="${style}">
    </#if>
    ${title}
    <#if style?has_content>
        </span>
    </#if>
</#macro>

Or should we format it so that the generated code (html) is more readable? For example:

<#macro renderFieldTitle style title><#if style?has_content><span class="${style}"></#if>
  ${title}
<#if style?has_content></span></#if></#macro>

I am trying to improve the new widget macro libraries and I am not sure how to proceed.

Jacopo

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to