Docly Developers
Knowledge base Bug Workaround available

Write attributes without spaces around the equals sign

In shortOn a .hash page that uses a master page (<!--#master ... --> with XDT), an attribute written with a space after the equals sign - class= "lead" - is served as class="" "lead". The browser then sees an empty class attribute and a stray token, the class is lost and the element is styled differently. Write every attribute as name="value" with no spaces around =.
Applies to HASH filesMaster pagesConverting existing sites
  1. What you'll see

    You move HTML from an existing site or a purchased template into .hash pages that use a master page, and some elements suddenly look different: a lead paragraph loses its font size, a block loses its margin. The source looks correct - the class is right there, written as <p class= "lead">.

  2. What's actually happening

    HTML allows whitespace around = in an attribute, so the original page rendered fine. When Docly merges a page into its master page, an attribute with a space after = is written out as class="" "lead". The browser parses that as an empty class and a separate attribute named "lead", so the class never applies.

    Measured 2026-11-28 on a scratch page with <!--#master file="#/Master.hash" --> and <main id="Content" xdt:Transform="Replace">:

    • class= "lead" was served as class="" "lead".
    • class ="lead" (space before =) and class="lead" were served unchanged.
    • The same page without the master page served class= "lead" unchanged, also with #{ }# code on the page.
    • The result was the same with and without a browser User-Agent.

    An earlier version of this entry blamed strict mode and said curl showed the correct markup. Both were wrong: the master-page merge causes it. Legacy templates often contain class= "..."; bpt.no had 81 in 12 templates, and one paragraph became 60 px shorter. Reported as DevOps bug #30984.

  3. What to do

    Normalise every attribute before or while converting, and check the rendered page with a browser User-Agent:

    // normalise attributes inside tags: name = "v" -> name="v"
    html = html.replace(/<[A-Za-z][^<>]*>/g, tag =>
        tag.replace(/(\s[\w:.-]+)\s*=\s*(["'])/g, '$1=$2'));

    Run the same normalisation over rich-text field values you migrate. They can contain the same pattern.

Last reviewed 28 Nov 2026