Skip to content

fix(collection): wrap intro text in a div, not a p - #3332

Open
Vidminas wants to merge 1 commit into
HugoBlox:mainfrom
Vidminas:fix/collection-intro-p-wrap
Open

fix(collection): wrap intro text in a div, not a p#3332
Vidminas wants to merge 1 commit into
HugoBlox:mainfrom
Vidminas:fix/collection-intro-p-wrap

Conversation

@Vidminas

Copy link
Copy Markdown

The collection block's intro text is rendered markdown (RenderString), which can be block-level (multiple paragraphs). Wrapping it in <p> is invalid — the inner block <p>s force the outer <p> closed, so any wrapper styling escapes.

🚀 What type of change is this?

  • 🐛 Bug fix (A non-breaking change that fixes an issue)
  • New feature (A non-breaking change that adds functionality)
  • 💅 Style change (A change that only affects formatting, visuals, or styling)
  • 📚 Documentation update (Changes to documentation only)
  • 🧹 Refactor or chore (A code change that neither fixes a bug nor adds a feature)
  • 💥 Breaking change (A fix or feature that would cause existing functionality to not work as expected)

🎯 What is the purpose of this change?

The collection block wraps its intro text in a <p>, but text is rendered markdown
(RenderString) and can be block-level (multiple paragraphs). A <p> may only contain inline
content, so the inner block <p>s force the outer <p> closed and any wrapper styling escapes.

Before (main), with a two-paragraph intro:

<p><p>Para one.</p>
<p>Para two block output.</p>
</p>

After:

<div><p>Para one.</p>
<p>Para two block output.</p>
</div>

Fix. Use a <div>. This is exactly what the markdown block already does
(blox/markdown/block.html), including a comment explaining it supports the prose class and
multiple paragraphs — so this just brings the collection block in line with its sibling.

Verified on the academic-cv starter with a temporary two-paragraph collection intro: the fixed
build nests the paragraphs inside a <div>; the same content on main produced the invalid
<p><p>…</p><p>…</p></p>.


📸 Screenshots or Screencast (if applicable)

n/a — invalid-HTML fix; see the before/after markup above.


ℹ️ Documentation Check

  • No, this change does not require a documentation update.
  • Yes, I have updated the documentation accordingly (or will in a follow-up PR).

📜 Contributor Agreement

Thank you for your contribution!

The collection block's intro `text` is rendered markdown (RenderString), which
can be block-level (multiple paragraphs). Wrapping it in `<p>` is invalid — the
inner block `<p>`s force the outer `<p>` closed, so any wrapper styling escapes.

Use a `<div>`, matching the markdown block (which documents the same rationale).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Vidminas
Vidminas requested a review from gcushen as a code owner July 10, 2026 09:10
@netlify

netlify Bot commented Jul 10, 2026

Copy link
Copy Markdown

Deploy Preview for academic-demo canceled.

Name Link
🔨 Latest commit f2159ad
🔍 Latest deploy log https://app.netlify.com/projects/academic-demo/deploys/6a50b720cbb28000087a7dd9

@github-actions

Copy link
Copy Markdown
Contributor

Wow, your first PR! Welcome to the community! 🎉

Thank you for this contribution to open source and open research. It makes a huge impact for the thousands of innovators building with Hugo Blox.

If you're wondering about next steps, please read our Contributor Guide for coding standards, how to run the project locally, and how to get help.

We hope this is just the start of your journey with us. Let's build the future together! Join us on Discord to connect with the team and community.

Awesome work, we'll take a look soon! ✨

@github-actions

Copy link
Copy Markdown
Contributor

This PR is stale because it has not had any recent activity. The resources of the project maintainers are limited, and so we are asking for your help.

If you feel that the PR is still relevant in the latest release, consider making the PR easier to review and finding developers to help review the PR.

Please be mindful that although we encourage PRs, we cannot expand the scope of the project in every possible direction. There will be requests that don't make the roadmap.

This PR will automatically close soon if no further activity occurs. Thank you for your contributions.

@github-actions github-actions Bot added the stale label Aug 10, 2026
@Vidminas

Copy link
Copy Markdown
Author

This is still relevant, keep open ^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant