Fix dropdown option spacing in markdown output #2359
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.
Fix dropdown option spacing in markdown output
Summary
This PR fixes a bug where HTML dropdown (
<select>/<option>) elements were being converted to markdown with no spacing between options, resulting in concatenated text like "Option1Option2Option3" instead of "Option1, Option2, Option3".Changes:
preprocessSelectElements()function that runs before HTML-to-markdown conversionvalue=""or text starting with "Select")The fix works uniformly across both the Go converter and TurndownService fallback by preprocessing the HTML before conversion.
Review & Testing Checklist for Human
Risk Level: Yellow (Medium risk - modifies core parsing logic with limited end-to-end testing)
Test Plan
Expected: Should see "Anaesthesiology & Pain Management, Arthroplasty And Sports Medicine, Cardiology, ..." with proper comma-space separation.
Notes
/^select\b/imight need refinement based on real-world usage patternsSession: https://app.devin.ai/sessions/b5d46cd2ec9d4285ad2cf6c9d1bc2027
Requested by: Micah Stairs (@micahstairs)
Summary by cubic
Fixes markdown conversion for HTML dropdowns by preprocessing select/option elements and outputting comma-separated lists. Prevents concatenated text like "Option1Option2Option3" across both the Go converter and Turndown fallback.
Written for commit 6daee32. Summary will update automatically on new commits.