Skip to content

Commit 4d1c663

Browse files
committed
fix: Improve story paragraph spacing and add text justification
- Change Redcarpet hard_wrap to false for proper paragraph rendering - Increase paragraph margin to 2rem with !important - Add text-align: justify for story content - Increase section header spacing to 3rem top margin - Force spacing with !important to override any conflicts
1 parent cb7c128 commit 4d1c663

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

app/helpers/works_helper.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ def markdown(text)
55
require "redcarpet"
66

77
renderer = Redcarpet::Render::HTML.new(
8-
hard_wrap: true,
8+
hard_wrap: false, # Don't convert line breaks to <br> - use proper paragraphs
99
link_attributes: { target: "_blank", rel: "noopener" }
1010
)
1111

@@ -14,7 +14,8 @@ def markdown(text)
1414
tables: true,
1515
fenced_code_blocks: true,
1616
strikethrough: true,
17-
superscript: true
17+
superscript: true,
18+
space_after_headers: true # Add space after headers
1819
)
1920

2021
markdown.render(text).html_safe

app/views/works/show.html.erb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,20 @@
7979

8080
/* Paragraphs - generous spacing for readability */
8181
.story-content p {
82-
margin-bottom: 1.75rem;
82+
margin-bottom: 2rem !important;
8383
line-height: 2;
8484
font-size: 1.125rem;
85+
text-align: justify;
8586
}
8687

8788
/* Bold text in paragraphs - acts as mini section headers */
8889
.story-content p strong {
8990
display: block;
9091
font-weight: 600;
91-
margin-top: 2rem;
92-
margin-bottom: 0.5rem;
92+
margin-top: 3rem !important;
93+
margin-bottom: 1rem !important;
9394
font-size: 1.25rem;
95+
text-align: left;
9496
}
9597

9698
/* Links */

0 commit comments

Comments
 (0)