fix: code blocks within tabbed content blocks are double spaced#1510
fix: code blocks within tabbed content blocks are double spaced#1510rafaumeu wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe ChangesTab Shortcode Whitespace Fix
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This PR has been automatically labelled "stale" because it hasn't had recent activity. |
Summary
Fixes #1303
Code blocks within tabbed content blocks were being double-spaced. The root cause was in the
tabHugo shortcode (site/layouts/shortcodes/tab.html), where{{ .Inner | markdownify }}did not trim surrounding whitespace. Hugo's template engine inserts the inner content with leading/trailing newlines, whichmarkdownifythen converts into extra<br>/paragraph breaks inside code blocks.Fix
Changed
{{ .Inner | markdownify }}to{{- .Inner | markdownify -}}using Hugo's whitespace trimming delimiters ({{-and-}}), which removes the surrounding newlines before markdown processing.