Write attributes without spaces around the equals sign
-
What you'll see
You move HTML from an existing site or a purchased template into
.hashpages 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">. -
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 asclass="" "lead". The browser parses that as an emptyclassand 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 asclass="" "lead".class ="lead"(space before=) andclass="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. -
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