Address issue #30: Fix line breaking in HTML exports#191
Merged
Conversation
Add universal export.css stylesheet for paragraph text wrapping in HTML exports and screen preview. This ensures long words and URLs wrap properly within their containers instead of causing horizontal overflow. Changes: - Create MacDown/Resources/Extensions/export.css with word-breaking rules for p, li, td, th, blockquote, dd, and body elements - Modify MPRenderer.m to load export.css in both stylesheets method (for screen preview) and HTMLForExportWithStyles method (for HTML exports) - Add comprehensive test suite in MPHTMLExportTests.m covering file existence, CSS content validation, stylesheet loading order, and HTML export integration The implementation follows the established pattern from issue #28 (PDF export fix) using a universal stylesheet loaded in the cascade. Related to #30
Move export.css loading to the END of the HTMLForExportWithStyles method to ensure proper cascade order. Previously, export.css was loaded before Prism stylesheets when highlighting was enabled, violating the principle that export.css should always be last. Also add test to verify CSS loading order in HTML exports with highlighting. Changes: - MPRenderer.m: Move export.css loading after all other stylesheets - MPHTMLExportTests.m: Add testExportCSSIsLastStylesheetInHTMLExportWithHighlighting Related to #30
- CSS_SPECIFICITY_ISSUE.md: Add section on export.css implementation - ISSUE_28_INVESTIGATION.md: Document parallel HTML export implementation - PDF_EXPORT_CSS_DEBUG_REPORT.md: Reference export.css as proof of pattern - infrastructure_evaluation.md: Update test coverage status - test_coverage_improvement_plan.md: Mark MPHTMLExportTests.m as completed Related to #30
Contributor
Code Coverage ReportCurrent Coverage: 42.14% Coverage Details (Summary) |
- Update category to properly expose 'stylesheets' method - Simplify stylesheet tests to avoid accessing private 'url' property - Use public htmlForOption: method to verify export.css content instead Related to #30
Replace MPExtensionURL calls with direct NSBundle resource lookups since the utility function isn't available to the test target.
The table test was failing because HOEDOWN_EXT_TABLES extension was not enabled in the mock delegate.
Owner
Author
|
Closes #30 |
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.
Summary
Add universal
export.cssstylesheet for paragraph text wrapping in HTML exports and screen preview. This ensures long words and URLs wrap properly within their containers instead of causing horizontal overflow.Changes:
MacDown/Resources/Extensions/export.csswith word-breaking rules for p, li, td, th, blockquote, dd, and body elementsMPRenderer.mto load export.css LAST in stylesheet cascade for both screen preview and HTML exportsMPHTMLExportTests.m(18 test cases covering file existence, content validation, loading order, and integration)Architecture:
Related Issue
Related to #30
Manual Testing Plan
Key Scenarios to Test
Testing Steps
Review Notes