Skip to content

Commit 3395026

Browse files
committed
Fix scroll and overflow on smaller screen
1 parent d999244 commit 3395026

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/gh_range_diff.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,11 @@ pub async fn gh_range_diff(
168168
}}
169169
summary {{
170170
font-weight: 800;
171+
overflow-wrap: break-word;
172+
white-space: normal;
173+
}}
174+
.diff-content {{
175+
overflow-x: auto;
171176
}}
172177
.removed-block {{
173178
background-color: rgb(255, 206, 203);
@@ -241,7 +246,7 @@ pub async fn gh_range_diff(
241246

242247
writeln!(
243248
html,
244-
r#"<details open=""><summary>{filename} <a href="{before_href}">before</a> <a href="{after_href}">after</a></summary><pre>{diff}</pre></details>"#
249+
r#"<details open=""><summary>{filename} <a href="{before_href}">before</a> <a href="{after_href}">after</a></summary><pre class="diff-content">{diff}</pre></details>"#
245250
)?;
246251
}
247252
Ok(())

0 commit comments

Comments
 (0)