fix(web): clean up markdown output for cards, logos and UI affordances#39
Merged
Conversation
The HTML→Markdown integration produced three artefacts on pages like /de.md: 1. Card components (services/projects/articles) wrap a heading + description in a single <a>. Turndown's link rule only handles inline content, so it emitted a stray "[" before the block and a dangling "](href)" after it. Add a `blockLink` Turndown rule that links the card's first heading instead. 2. The customer logo marquee and the schematic service visuals duplicated content (aria-hidden marquee copies, decorative SVGs, eyebrow glyphs), which showed up doubled / as junk in Markdown. Strip `[aria-hidden="true"]` before conversion — decorative content hidden from assistive tech should be hidden from Markdown too. 3. Add a generic `.md-exclude` opt-out class for UI-only affordances and apply it to the testimonials "show more" button. Verified by running the conversion pipeline against the live /de HTML. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CmWTCNSATpSf21dgP5ZV8g
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Preview Deployment
The Web preview uses the CMS preview URL for content fetching. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enhances the HTML-to-Markdown converter to properly handle card components (services, projects, articles) that wrap block-level content in anchor tags, and excludes UI-only elements from the Markdown output.
Changes
blockLinkrule to Turndown: Detects anchors wrapping block-level content (headings, paragraphs, divs, lists) and converts them intelligently by linking the first heading while preserving remaining content as normal blocks. Falls back to linking collapsed text if no heading is present..md-excludeclass oraria-hidden="true"attribute before conversion, preventing UI-only affordances (buttons, decorative icons, duplicate content) from appearing in Markdown.md-excludeclass to the "see more" fade overlay button to prevent it from being included in the Markdown representation.Implementation Details
The
blockLinkrule uses a regex to detect and rewrite Markdown headings with inline links, preserving the heading structure while applying the link to the heading text only. This prevents malformed Markdown output that would occur with Turndown's default link handling for block-wrapping anchors.https://claude.ai/code/session_01CmWTCNSATpSf21dgP5ZV8g