@gurupanguji

wp:quote Safe Shape Paragraph Breaks Implementation Plan

For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (- [ ]) syntax for tracking.

Goal: Extend scripts/normalize_wp_quotes.py so wp:quote paragraphs with harmless <p> attributes, <br /><br /> paragraph breaks, empty spacing paragraphs, and link-only paragraphs count as safe, while keeping file-level skip reporting for any still-unsupported quote blocks.

Architecture: Make a narrow parser change in the quote normalizer rather than broadening the entire HTML model. Add tests first for the new paragraph shapes, then implement the minimal matcher and rendering update, then rerun the dry-run normalizer to inspect which files still skip and why.

Tech Stack: Python 3, unittest, regex parsing, markdown generation for Jekyll posts


Task 1: Add Failing Tests For The New Safe Shape

Files:

Cover a wp:quote block whose paragraph content includes <br /><br /> and assert the markdown output becomes:

> Paragraph one.
>
> Paragraph two.

Use the user-provided third-block example shape and assert the paragraph itself is now considered safe.

Cover:

Construct a post with:

Assert the whole file remains skipped and that a reason is still reported.

Run:

python3 -m unittest tests/test_normalize_wp_quotes.py

Expected: FAIL on the new cases before implementation.

Task 2: Expand The Safe Quote Matcher

Files:

Adjust the paragraph parser so <p> tags with attributes like id still match as safe quote paragraphs.

Implement the smallest possible rendering change so double breaks become:

>

between quote paragraphs instead of collapsing into one run-on block.

Implement the smallest possible support for:

Do not relax support for:

Run:

python3 -m unittest tests/test_normalize_wp_quotes.py

Expected: PASS

Task 3: Re-run The Dry-Run Audit

Files:

Run:

python3 scripts/normalize_wp_quotes.py

Check whether _posts/2025-07-21-negativity-blackholes-unburdening-and-resilience.md now:

Capture the current skip list so the user can provide the next safe-shape suggestion from a concrete backlog instead of guessing.

Task 4: Verify And Prepare Review

Files:

Run:

python3 -m unittest tests/test_normalize_wp_quotes.py

Expected: PASS

Verify the implementation changes are limited to:

Make sure the final report still includes which files remain skipped, because the user explicitly wants that list to drive the next cleanup rule.