Skip to content

Commit

Permalink
Allow scrolling in iframe (ordinals#3947)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphjaph authored Sep 14, 2024
1 parent 5953cca commit ed19df5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/subcommand/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3826,7 +3826,7 @@ mod tests {
<dl>
<dt>inscriptions</dt>
<dd class=thumbnails>
<a href=/inscription/.*><iframe sandbox=allow-scripts scrolling=no loading=lazy src=/preview/.*></iframe></a>
<a href=/inscription/.*><iframe sandbox=allow-scripts loading=lazy src=/preview/.*></iframe></a>
</dd>.*",
);
}
Expand Down
6 changes: 3 additions & 3 deletions src/templates/iframe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl Display for Iframe {

write!(
f,
"<iframe sandbox=allow-scripts scrolling=no loading=lazy src=/preview/{}></iframe>",
"<iframe sandbox=allow-scripts loading=lazy src=/preview/{}></iframe>",
self.inscription_id
)?;

Expand All @@ -50,15 +50,15 @@ mod tests {
assert_regex_match!(
Iframe::thumbnail(inscription_id(1))
.0.to_string(),
"<a href=/inscription/1{64}i1><iframe sandbox=allow-scripts scrolling=no loading=lazy src=/preview/1{64}i1></iframe></a>",
"<a href=/inscription/1{64}i1><iframe sandbox=allow-scripts loading=lazy src=/preview/1{64}i1></iframe></a>",
);
}

#[test]
fn main() {
assert_regex_match!(
Iframe::main(inscription_id(1)).0.to_string(),
"<iframe sandbox=allow-scripts scrolling=no loading=lazy src=/preview/1{64}i1></iframe>",
"<iframe sandbox=allow-scripts loading=lazy src=/preview/1{64}i1></iframe>",
);
}
}

0 comments on commit ed19df5

Please sign in to comment.