Closed (fixed)
Project:
Content First
Version:
2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
7 May 2026 at 09:23 UTC
Updated:
21 May 2026 at 10:10 UTC
Jump to comment: Most recent
The Markdown output produced by ContentFirstBuilder had several rendering issues affecting real-world Drupal content:
<div> and other stripped block elements caused adjacent text nodes to concatenate with no separator (e.g. FooBar instead of two separate lines).# Heading) did not always start on their own line, breaking parsers that require a preceding blank line.> ) did not always start on their own line for the same reason.<blockquote> produced spurious empty lines at the start of the block.<picture> / <div> nesting accumulated leading/trailing spaces after strip_tags(), resulting in broken image tokens like  .html_entity_decode() was applied before strip_tags(), which decoded entities in <pre><code> blocks (e.g. &lt;div&gt; → <div>) and then stripped the decoded tags, corrupting code block content.ContentFirstBuilder preprocessing pipeline:
</strong> <em>) is preserved.div, section, article, etc.) with a newline before strip_tags() to prevent text concatenation.html_entity_decode() — HtmlConverter uses DOMDocument internally which decodes entities naturally. Applying it beforehand corrupts code blocks.strip_tags(), normalize whitespace around media elements (<img>, <embed>) to fix stray spaces left by stripped container tags.RenderedContent Markdown fixes:
Test coverage added:
RenderedContentTest: heading rendering, blockquote placement (6 parameterized cases including false-positive guards), multi-paragraph blockquotes, picture element passthrough, nested lists, full landing page integration.HtmlTagTransformerTest: 20 tests covering transformSelfClosingTags() and transformPairedTags() (attributes, case insensitivity, multiple occurrences, unlisted tags, empty input).Review and merge.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
gedur commentedComment #3
gedur commentedComment #4
gedur commentedComment #5
gedur commentedComment #7
gedur commentedComment #9
gedur commented