Fix InlineMultiQuestion: stop flex-wrapping text-only and blank-only paragraphs#1468
Draft
Fix InlineMultiQuestion: stop flex-wrapping text-only and blank-only paragraphs#1468
Conversation
Copilot
AI
changed the title
[WIP] Fix inline question weird form rendering
Fix InlineMultiQuestion: stop flex-wrapping text-only and blank-only paragraphs
Apr 8, 2026
27ce6c0 to
f6bf216
Compare
…nk-only paragraphs Agent-Logs-Url: https://github.com/inducer/relate/sessions/b158f964-365c-495e-ae0f-959d7bf5e5b3 Co-authored-by: inducer <352067+inducer@users.noreply.github.com>
f6bf216 to
ced2eab
Compare
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.
InlineMultiQuestion.get_question()unconditionally replaced every<p>tag with a Bootstrapinput-groupflex container, causing garbled rendering when[[blank]]markers appear on their own paragraph (separated from surrounding text by blank lines in markdown).Root cause
The old approach was a blunt string replace:
This produced flex containers around text-only paragraphs (breaking normal text flow) and split flex containers that straddled blank-only paragraphs (broken HTML structure around the form fields).
Fix
get_question()now usesre.subwith a per-paragraph callback that classifies each<p>…</p>block:[[id]]only<div class="input-group …">[[id]]</div>[[id]]— block form field, no wrapper[[id]]inline<div class="input-group …">…</div><div class="input-group …">text</div><p>text</p>— normal paragraphThe
mb-4spacing class is still applied to the last flex div when one exists.