Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(workflows): draft ai emails as editable native unlayer blocks (#120205)

Harley Alexander98963b1f2fe0
diff --git a/products/messaging/backend/services/design_validation.py b/products/messaging/backend/services/design_validation.py
index 9b673fc58296..c5006d3a7c51 100644
--- a/products/messaging/backend/services/design_validation.py
+++ b/products/messaging/backend/services/design_validation.py
@@ -14,6 +14,7 @@ from products.messaging.backend.unlayer import CUSTOM_TOOL_HTML_OPTIONS
KNOWN_CONTENT_TYPES = frozenset(
{
"text",
+ "paragraph",
"heading",
"button",
"image",
diff --git a/products/messaging/backend/tests/api/test_design_operations.py b/products/messaging/backend/tests/api/test_design_operations.py
index e1e2520da31d..7ce5875fdc93 100644
--- a/products/messaging/backend/tests/api/test_design_operations.py
+++ b/products/messaging/backend/tests/api/test_design_operations.py
@@ -197,8 +197,11 @@ class TestApplyDesignOperations:
class TestValidateDesign:
- def test_valid_design_returns_no_blocking_warnings(self):
- assert validate_design(_sample_design()) == []
+ @pytest.mark.parametrize("content_type", ["text", "paragraph"])
+ def test_valid_design_returns_no_blocking_warnings(self, content_type: str) -> None:
+ design = _sample_design()
+ design["body"]["rows"][0]["columns"][0]["contents"][0]["type"] = content_type
+ assert validate_design(design) == []
def test_duplicate_id_raises(self):
design = _sample_design()
diff --git a/products/workflows/frontend/Workflows/workflowAgentContext.ts b/products/workflows/frontend/Workflows/workflowAgentContext.ts
index f4cdecbc61b8..04973c6335cb 100644
--- a/products/workflows/frontend/Workflows/workflowAgentContext.ts
+++ b/products/workflows/frontend/Workflows/workflowAgentContext.ts
@@ -116,11 +116,16 @@ const DRAFT_FIRST_CONTEXT_ITEM: AttachedContextItem = {
hidden: true,
dismissGroup: NEW_WORKFLOW_DISMISS_GROUP,
value:
- 'The user is starting a new workflow from a description. Make workflows-create your first tool call and ' +
- 'keep it minimal: the trigger plus the steps as placeholders, with placeholder email subjects and bodies. ' +
- 'Do not ask clarifying questions first. The editor opens the draft the moment it exists, so fill in ' +
- 'content and details afterwards with workflows-patch-graph and workflows-patch-action-email, then test. ' +
- 'Never enable it.',
+ 'The user is starting a new workflow from a description. Work draft-first:\n' +
+ `1. Load the ${DESIGNING_EMAIL_TEMPLATES_SKILL} skill.\n` +
+ '2. Make workflows-create your first workflows tool call; questions wait until the draft exists. Keep it ' +
+ 'minimal: the trigger plus each step as a placeholder. Each email step gets a placeholder subject, a ' +
+ "plain-text text, and a design copied from the skill reference's minimal example. Leave html out: step 4 " +
+ 'renders it from the design. Done when the draft exists; the editor opens it at once.\n' +
+ '3. Fill in the details with workflows-patch-graph.\n' +
+ '4. Fill each email with one workflows-patch-action-email call: block operations for the content, plus an ' +
+ 'email_patch with the real subject and a matching text. Done when no email holds placeholder copy.\n' +
+ '5. Test the workflow and leave it disabled.',
}
/** Skill pointer plus the draft-first instruction, no editor state. Not dismissible: the page only advances once the draft exists. */
diff --git a/products/workflows/package.json b/products/workflows/package.json
index 8338cf9fa482..a563cf940c79 100644
--- a/products/workflows/package.json
+++ b/products/workflows/package.json
@@ -1,7 +1,7 @@
{
"name": "@posthog/products-workflows",
"scripts": {
- "backend:test": "pytest -c ../../pytest.ini --rootdir ../.. backend/ -v --tb=short",
+ "backend:test": "pytest -c ../../pytest.ini --rootdir ../.. backend/ skills/ -v --tb=short",
"backend:contract-check": "echo 'Contract files unchanged'"
},
"dependencies": {
diff --git a/products/workflows/skills/designing-email-templates/SKILL.md b/products/workflows/skills/designing-email-templates/SKILL.md
index 24b2995562df..7f46b0fcb3f3 100644
--- a/products/workflows/skills/designing-email-templates/SKILL.md
+++ b/products/workflows/skills/designing-email-templates/SKILL.md
@@ -9,7 +9,7 @@ Use this skill when creating or editing email templates for PostHog workflows
## How authoring works
-You author the **design JSON** (`content.email.design`) and save it with `workflows-create-email-template`. The server renders the sent email from your design with the same renderer PostHog's visual editor uses, so the template opens as editable blocks for humans and sends exactly what the design describes. Schema and a working example in [references/unlayer-design-json.md](references/unlayer-design-json.md).
+You author the **design JSON** (`content.email.design`) and save it with `workflows-create-email-template`. The server renders the sent email from your design with the same renderer PostHog's visual editor uses, so the template opens as editable blocks for humans and sends exactly what the design describes. Schema, the native blocks and spacing rules every email follows, and a working example in [references/unlayer-design-json.md](references/unlayer-design-json.md).
When talking to the user, call it the template's **design** — the design document format is an internal implementation detail. Always share the template's `_posthogUrl` edit link in your reply after creating or updating, so the user can open it in PostHog directly.
@@ -31,6 +31,12 @@ Marketing emails must include an unsubscribe link — render it with the built-i
(`{{ unsubscribe_url_one_click }}` is also available for one-click list-unsubscribe flows.)
+Output is HTML-escaped by default, so a value renders as text even when it contains markup:
+
+- Don't add `| escape`. It escapes a second time, and `&` reaches the inbox as `&`.
+- For HTML your own backend builds, such as a summary list, add `| raw`: `{{ variables.summary_html | raw }}`. Never use `raw` on text a person typed.
+- Format money with `currency`: `{{ variables.amount | currency: "USD" }}` renders `$1,234.50`. A value that isn't a number renders unchanged.
+
## Click tracking and opt-out
Every link is automatically rewritten through a click-tracking redirect. This breaks mobile universal links / app deeplinks, which only resolve when the href stays on their own domain. To keep a link untracked, mark its anchor (use an `html` block) with `clicktracking="off"` or `data-ph-no-track`:
@@ -68,7 +74,11 @@ Call `workflows-create-email-template` with:
"templating": "liquid",
"email": {
"subject": "Welcome to {{ person.properties.company | default: 'our product' }}",
- "design": { "counters": { "u_row": 1 }, "schemaVersion": 16, "body": { "rows": ["…"] } },
+ "design": {
+ "counters": { "u_row": 1 },
+ "schemaVersion": 16,
+ "body": { "rows": ["…"], "values": { "preheaderText": "Three short steps to get you set up" } }
+ },
"text": "Plain-text fallback of the same message"
}
}
@@ -76,6 +86,7 @@ Call `workflows-create-email-template` with:
```
- `subject` is required for email templates.
+- Put the preview text that most inboxes show after the subject in the design's `body.values.preheaderText`. The rendered html carries it, so it reaches the inbox on every send path. Leave `content.email.preheader` unset, so the email carries one preview text.
- Always author the `design` and omit `html` - the server renders html from the design. Sending hand-written html without a design produces an email the visual editor can only show as one raw block.
- Always provide `text` as a real plain-text rendering of the message - clients that block rich content show only `text`, so filler like "placeholder" reaches real inboxes, and a text part that doesn't match the html hurts deliverability.
- The tool result returns an edit link into the PostHog library.
@@ -85,6 +96,17 @@ Call `workflows-create-email-template` with:
Pass the design directly in the tool call — no scratch files, no pre-validation subprocesses, no payload preview rounds. Liquid tags (`{{ }}`, `{% %}`), apostrophes, single quotes, and emoji are ordinary characters inside JSON strings; only standard JSON escaping applies. Never rewrite content to avoid them — converting Liquid's single quotes to double quotes inside markup attributes breaks the markup. If the tool call is rejected as malformed, fix the JSON escaping and resend the same content unchanged.
+## Converting an existing HTML email
+
+To move an email from another platform, rebuild it from native blocks instead of pasting its HTML into one `html` block, so people can still edit it:
+
+- Each part of the source becomes the native block it shows: a `heading`, a `text` block per paragraph, a `button` per call to action, an `image` per picture. Keep the source's colors, font sizes, and padding on each block.
+- Re-host every image through the media library (see Images). Put the file's real dimensions in `src.width` and `src.height`, and set the displayed width with `src.maxWidth` as a percentage of the content width. Source HTML often declares a height that doesn't match the file.
+- A section the source wraps in `{% if %}` becomes a block with a display condition (see [references/unlayer-design-json.md](references/unlayer-design-json.md)).
+- Rename the source platform's Liquid variables to the ones this send provides. A transactional API send provides everything the caller passes in `message_data` as `{{ variables.* }}`.
+- Buttons have no `box-shadow`. A 3px bottom border in a darker shade (`border.borderBottomWidth`, `borderBottomStyle`, `borderBottomColor`) gives the same raised look.
+- The `social` block draws only its own icon sets. To keep custom icons, put the icon row in an `html` block with the re-hosted images.
+
## Editing a template (read–modify–write)
`content` is replaced as a whole on update, never merged — and humans may have edited the design in PostHog's visual editor since you last saw it:
@@ -102,7 +124,7 @@ A `function_email` step carries its own email snapshot (`config.inputs.email.val
Edit it with `workflows-patch-action-email`: the same design operations as `workflows-patch-email-template`, plus an `email_patch` merge for subject, preheader, text, and recipients.
1. `workflows-get` — the step's current design (and its block ids) is in `config.inputs.email.value.design`.
-2. `workflows-patch-action-email` with the workflow id, the step's `action_id`, and your operations and/or `email_patch`.
+2. `workflows-patch-action-email` with the workflow id, the step's `action_id`, and your operations and/or `email_patch`. When the operations change the copy, the same call's `email_patch` sets a matching `text`.
3. The HTML is re-rendered server-side from the patched design, so it never goes stale.
4. On an active workflow the edit stages a draft — test with `workflows-test-run` (`use_draft=true`) and apply it with `workflows-publish`.
diff --git a/products/workflows/skills/designing-email-templates/references/design-guidelines.md b/products/workflows/skills/designing-email-templates/references/design-guidelines.md
index 8161c289aef0..a6e776141fb6 100644
--- a/products/workflows/skills/designing-email-templates/references/design-guidelines.md
+++ b/products/workflows/skills/designing-email-templates/references/design-guidelines.md
@@ -4,7 +4,7 @@ These guidelines adapt strong frontend design practice to the email medium — t
## Commit to a direction first
-Before writing markup, decide:
+Before composing, decide:
- **Purpose and audience** — transactional receipt, product announcement, win-back campaign, and onboarding emails each warrant different energy.
- **Tone** — pick one and execute it precisely: brutally minimal, editorial/magazine, luxury/refined, playful, industrial/utilitarian. Intentionality beats intensity.
@@ -32,7 +32,7 @@ Before writing markup, decide:
## Visual details that survive email clients
-- **Bulletproof CTA buttons**: a padded `<td>` with `bgcolor`, border-radius, and an inline-styled `<a>` — not an image, not a CSS-only button.
+- **CTA buttons**: a native `button` block with a solid background color, padding, and border-radius, so people edit its text and link in the editor (shape in [unlayer-design-json.md](unlayer-design-json.md)).
- Solid `bgcolor` sections, border accents (a 4px top border in the accent color is cheap and distinctive), and spacer rows are the reliable atmosphere tools. Gradients, background images, and shadows are enhancement-only — the design must work without them.
- A real text preheader (hidden with inline styles) controls the inbox preview line — write it like ad copy, don't let the client scrape your header nav.
@@ -42,7 +42,7 @@ Centered white card on gray, purple gradient header, Arial everywhere at uniform
## Quality pass before saving
-1. Read the design top to bottom: every text-block element styled inline, palette values consistent, alt text on images.
+1. Read the design top to bottom: every block carries its spacing values (see [unlayer-design-json.md](unlayer-design-json.md)), palette values consistent, alt text on images.
2. Squint test on the rendered preview: clear hierarchy — eye lands on headline → key message → CTA.
3. Confirm Liquid variables have `| default:` fallbacks so no reader sees a blank.
4. Confirm the plain-text version carries the full message, not a stub.
diff --git a/products/workflows/skills/designing-email-templates/references/unlayer-design-json.md b/products/workflows/skills/designing-email-templates/references/unlayer-design-json.md
index 7d993978ebc7..656000b880f9 100644
--- a/products/workflows/skills/designing-email-templates/references/unlayer-design-json.md
+++ b/products/workflows/skills/designing-email-templates/references/unlayer-design-json.md
@@ -12,8 +12,11 @@ Adapted from [unlayer/unlayer-skills](https://github.com/unlayer/unlayer-skills)
- Column structure
- Content item structure
- Content types
+- Native blocks and spacing
+- Showing a block conditionally
- Validation constants
- Minimal working example
+- Editing blocks with operations
## Top-level structure
@@ -123,7 +126,8 @@ interface ContentItem {
// --- Tool-specific properties vary per type ---
// text/heading: { text: string } — text is an HTML fragment
// image: { src: { url, width, height }, alt, action } — url from media-image-upload-complete or media-images-list, see SKILL.md#images
- // button: { text, href, buttonColors, size, borderRadius, ... }
+ // button: { text, href: { name: 'web', values: { href, target } }, buttonColors, size, borderRadius, ... }
+ // divider: { width, border: { borderTopWidth, borderTopStyle, borderTopColor } }
// html: { html: string } — raw HTML block
}
}
@@ -135,6 +139,43 @@ interface ContentItem {
The `html` content type is an escape hatch: a single raw-HTML block inside the design. Useful for fragments the block editor can't express, but humans can only edit it as a markup blob.
+## Native blocks and spacing
+
+Compose every email from native blocks: a `heading`, one `text` block per paragraph, a `button` per call to action, and a `divider` between sections. People edit each block on its own in the visual editor, and patch operations address it by id.
+
+- **Paragraphs** are `text` blocks, one paragraph each. The editor's Paragraph block (`type: "paragraph"`) needs editor-only `textJson` state and loads empty without it.
+- **Spacing values** live on the block: `containerPadding` on every block, plus `fontSize` and `lineHeight` on `heading` and `text`. `"8px 24px"`, `"16px"`, and `"150%"` on every paragraph give a 16px gap.
+- **Markup spacing** shows only in the inbox: the editor canvas strips `<p>` margins, so spacing written as markup looks cramped in the editor. The spacing values are the one place spacing goes.
+- **Defaults** fill a missing spacing value (`10px` padding, `14px` text), so that block sits closer and smaller than its neighbors. Every block, including one added later by a patch operation, carries its own spacing values.
+- **Button links** are an object: `"href": { "name": "web", "values": { "href": "https://example.com/setup", "target": "_blank" } }`. The editor shows the URL in the button's own link field.
+
+Write only these values. The editor fills every other key (`anchor`, `linkStyle`, `hideDesktop`, `selectable`, and so on) with its default when it loads the design.
+
+## Showing a block conditionally
+
+To show a block only when a Liquid condition holds, give it a `displayCondition`. The rendered email wraps the block's markup in `before` and `after`, so the condition removes the whole block, padding included. The editor shows the `label` on the block.
+
+```json
+{
+ "type": "text",
+ "values": {
+ "text": "<p>Your new credits are ready to use.</p>",
+ "fontSize": "16px",
+ "lineHeight": "150%",
+ "containerPadding": "8px 24px",
+ "displayCondition": {
+ "type": "liquid",
+ "label": "Credits customers only",
+ "description": "Shown when the send includes credits",
+ "before": "{% if variables.show_credits %}",
+ "after": "{% endif %}"
+ }
+ }
+}
+```
+
+Put a condition on each block it covers. Never split one `{% if %}` across the text of two blocks, because the editor can reorder or delete one of them.
+
## Validation constants
| Constant | Valid values |
@@ -146,71 +187,143 @@ The `html` content type is an escape hatch: a single raw-HTML block inside the d
## Minimal working example
+A heading, two paragraphs, a button, and a divider, spaced as described above:
+
```json
{
- "counters": { "u_row": 1, "u_column": 1, "u_content_text": 1 },
+ "counters": {
+ "u_row": 1,
+ "u_column": 1,
+ "u_content_heading": 1,
+ "u_content_text": 2,
+ "u_content_button": 1,
+ "u_content_divider": 1
+ },
"schemaVersion": 16,
"body": {
- "id": "_BZCs8S2YW",
+ "id": "welcome-body",
+ "headers": [],
+ "footers": [],
+ "values": {
+ "backgroundColor": "#ffffff",
+ "contentWidth": "600px",
+ "textColor": "#1d1f27",
+ "fontFamily": { "label": "Arial", "value": "arial,helvetica,sans-serif" }
+ },
"rows": [
{
- "id": "LB2ltnM2OZ",
+ "id": "row-main",
"cells": [1],
+ "values": { "padding": "0px", "_meta": { "htmlID": "u_row_1", "htmlClassNames": "u_row" } },
"columns": [
{
- "id": "HI7oaTElxq",
+ "id": "col-main",
+ "values": { "_meta": { "htmlID": "u_column_1", "htmlClassNames": "u_column" } },
"contents": [
{
- "id": "PKtuJs3uBF",
+ "id": "heading-welcome",
+ "type": "heading",
+ "values": {
+ "headingType": "h1",
+ "text": "Welcome, {{ person.properties.first_name | default: 'there' }}",
+ "fontSize": "26px",
+ "lineHeight": "130%",
+ "textAlign": "left",
+ "containerPadding": "32px 24px 8px",
+ "_meta": { "htmlID": "u_content_heading_1", "htmlClassNames": "u_content_heading" }
+ }
+ },
+ {
+ "id": "text-intro",
+ "type": "text",
+ "values": {
+ "text": "<p>Thanks for signing up. Over the next week we will send you a few short emails that help you get set up.</p>",
+ "fontSize": "16px",
+ "lineHeight": "150%",
+ "textAlign": "left",
+ "containerPadding": "8px 24px",
+ "_meta": { "htmlID": "u_content_text_1", "htmlClassNames": "u_content_text" }
+ }
+ },
+ {
+ "id": "text-next-step",
"type": "text",
"values": {
- "containerPadding": "10px",
- "anchor": "",
+ "text": "<p>Start by connecting your first data source. Everything else builds on it.</p>",
+ "fontSize": "16px",
+ "lineHeight": "150%",
"textAlign": "left",
- "lineHeight": "140%",
- "linkStyle": {
- "inherit": true,
- "linkColor": "#0000ee",
- "linkHoverColor": "#0000ee",
- "linkUnderline": true,
- "linkHoverUnderline": true
+ "containerPadding": "8px 24px",
+ "_meta": { "htmlID": "u_content_text_2", "htmlClassNames": "u_content_text" }
+ }
+ },
+ {
+ "id": "button-setup",
+ "type": "button",
+ "values": {
+ "text": "Connect a data source",
+ "href": { "name": "web", "values": { "href": "https://example.com/setup", "target": "_blank" } },
+ "buttonColors": {
+ "color": "#FFFFFF",
+ "backgroundColor": "#1d4aff",
+ "hoverColor": "#FFFFFF",
+ "hoverBackgroundColor": "#1d4aff"
},
- "hideDesktop": false,
- "displayCondition": null,
- "_meta": { "htmlID": "u_content_text_1", "htmlClassNames": "u_content_text" },
- "selectable": true,
- "draggable": true,
- "duplicatable": true,
- "deletable": true,
- "hideable": true,
- "text": "<p>Hello World</p>"
+ "fontSize": "16px",
+ "padding": "12px 24px",
+ "borderRadius": "6px",
+ "textAlign": "left",
+ "containerPadding": "16px 24px",
+ "_meta": { "htmlID": "u_content_button_1", "htmlClassNames": "u_content_button" }
+ }
+ },
+ {
+ "id": "divider-footer",
+ "type": "divider",
+ "values": {
+ "width": "100%",
+ "border": { "borderTopWidth": "1px", "borderTopStyle": "solid", "borderTopColor": "#E5E7EB" },
+ "textAlign": "center",
+ "containerPadding": "16px 24px",
+ "_meta": { "htmlID": "u_content_divider_1", "htmlClassNames": "u_content_divider" }
}
}
- ],
- "values": {
- "_meta": { "htmlID": "u_column_1", "htmlClassNames": "u_column" },
- "border": {},
- "padding": "0px",
- "backgroundColor": ""
- }
+ ]
}
- ],
- "values": {
- "displayCondition": null,
- "columns": false,
- "backgroundColor": "",
- "columnsBackgroundColor": "",
- "backgroundImage": { "url": "", "fullWidth": true, "repeat": false, "center": true, "cover": false },
- "padding": "0px"
- }
+ ]
}
- ],
- "headers": [],
- "footers": [],
+ ]
+ }
+}
+```
+
+## Editing blocks with operations
+
+`workflows-patch-action-email` and `workflows-patch-email-template` address blocks by id. An `update_content` patch deep-merges into the block, so this changes only the button URL and keeps `name` and `target`:
+
+```json
+{
+ "op": "update_content",
+ "id": "button-setup",
+ "patch": { "values": { "href": { "values": { "href": "https://example.com/get-started" } } } }
+}
+```
+
+A paragraph added with `add_content` carries the same spacing values as the other paragraphs:
+
+```json
+{
+ "op": "add_content",
+ "column_id": "col-main",
+ "index": 3,
+ "content": {
+ "type": "text",
"values": {
- "backgroundColor": "#ffffff",
- "contentWidth": "600px",
- "fontFamily": { "label": "Arial", "value": "arial,helvetica,sans-serif" }
+ "text": "<p>Questions? Reply to this email and we will help.</p>",
+ "fontSize": "16px",
+ "lineHeight": "150%",
+ "textAlign": "left",
+ "containerPadding": "8px 24px"
}
}
}
diff --git a/products/workflows/skills/designing-email-templates/tests/test_unlayer_design_reference.py b/products/workflows/skills/designing-email-templates/tests/test_unlayer_design_reference.py
new file mode 100644
index 000000000000..201e93646bb0
--- /dev/null
+++ b/products/workflows/skills/designing-email-templates/tests/test_unlayer_design_reference.py
@@ -0,0 +1,64 @@
+import re
+import json
+from pathlib import Path
+from typing import Any
+
+from products.messaging.backend.facade.api import apply_design_operations, validate_design
+
+REFERENCE = Path(__file__).resolve().parent.parent / "references" / "unlayer-design-json.md"
+JSON_FENCE = re.compile(r"```json\n(.*?)\n```", re.DOTALL)
+READABLE_PARAGRAPH_SPACING = ("8px 24px", "16px", "150%")
+
+
+def _json_examples() -> list[dict[str, Any]]:
+ return [json.loads(block) for block in JSON_FENCE.findall(REFERENCE.read_text(encoding="utf-8"))]
+
+
+def _example_design() -> dict[str, Any]:
+ (design,) = [example for example in _json_examples() if "body" in example]
+ return design
+
+
+def _example_operations() -> list[dict[str, Any]]:
+ return [example for example in _json_examples() if "op" in example]
+
+
+def _blocks(design: dict[str, Any], block_type: str) -> list[dict[str, Any]]:
+ return [
+ content
+ for row in design["body"]["rows"]
+ for column in row["columns"]
+ for content in column["contents"]
+ if content["type"] == block_type
+ ]
+
+
+def _spacing(block: dict[str, Any]) -> tuple[str, str, str]:
+ values = block["values"]
+ return values["containerPadding"], values["fontSize"], values["lineHeight"]
+
+
+class TestUnlayerDesignReference:
+ def test_example_design_validates_without_warnings(self) -> None:
+ assert validate_design(_example_design()) == []
+
+ def test_documented_operations_relink_the_button_and_keep_paragraphs_evenly_spaced(self) -> None:
+ design = _example_design()
+ operations = _example_operations()
+ (button,) = _blocks(design, "button")
+ (relink,) = [op for op in operations if op["op"] == "update_content" and op["id"] == button["id"]]
+ new_link = relink["patch"]["values"]["href"]["values"]["href"]
+
+ patched = apply_design_operations(design, operations)
+
+ assert validate_design(patched) == []
+ (patched_button,) = _blocks(patched, "button")
+ assert patched_button["values"]["href"] == {
+ "name": "web",
+ "values": {"href": new_link, "target": button["values"]["href"]["values"]["target"]},
+ }
+ assert new_link != button["values"]["href"]["values"]["href"]
+ paragraphs = _blocks(patched, "text")
+ assert len(paragraphs) > len(_blocks(design, "text"))
+ assert {_spacing(paragraph) for paragraph in paragraphs} == {READABLE_PARAGRAPH_SPACING}
+ assert all(paragraph["values"]["text"].count("<p") == 1 for paragraph in paragraphs)