Skip to content

Commit

Permalink
fix: don't add extra semicolon after wrapperStyle (#8864)
Browse files Browse the repository at this point in the history
Remove unnecessary semicolon & don’t use null in String
  • Loading branch information
emilbruckner authored and pieh committed Oct 8, 2018
1 parent f246233 commit 9944450
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ exports[`it handles goofy nesting properly 1`] = `
"
<span
class=\\"gatsby-resp-image-wrapper\\"
style=\\"position: relative; display: block; ; max-width: 300px; margin-left: auto; margin-right: auto;\\"
style=\\"position: relative; display: block; max-width: 300px; margin-left: auto; margin-right: auto;\\"
>
<span
class=\\"gatsby-resp-image-background-image\\"
Expand All @@ -28,7 +28,7 @@ exports[`it leaves images that are already linked alone 1`] = `
"
<span
class=\\"gatsby-resp-image-wrapper\\"
style=\\"position: relative; display: block; ; max-width: 300px; margin-left: auto; margin-right: auto;\\"
style=\\"position: relative; display: block; max-width: 300px; margin-left: auto; margin-right: auto;\\"
>
<span
class=\\"gatsby-resp-image-background-image\\"
Expand All @@ -51,7 +51,7 @@ exports[`it leaves images that are already linked alone 1`] = `
exports[`it leaves linked HTML img tags alone 1`] = `
"<a href=\\"https://example.org\\">
<span class=\\"gatsby-resp-image-wrapper\\" style=\\"position: relative; display: block; ; max-width: 300px; margin-left: auto; margin-right: auto;\\">
<span class=\\"gatsby-resp-image-wrapper\\" style=\\"position: relative; display: block; max-width: 300px; margin-left: auto; margin-right: auto;\\">
<span class=\\"gatsby-resp-image-background-image\\" style=\\"padding-bottom: 133.33333333333331%; position: relative; bottom: 0; left: 0; background-image: url(&apos;url(&apos;data:image/png;base64, iVBORw)&apos;); background-size: cover; display: block;\\">
<img class=\\"gatsby-resp-image-image\\" style=\\"width: 100%; height: 100%; margin: 0; vertical-align: middle; position: absolute; top: 0; left: 0; box-shadow: inset 0px 0px 0px 400px white;\\" alt=\\"this image already has a link\\" title=\\"\\" src=\\"not-a-real-dir/images/this-image-already-has-a-link.jpeg\\" srcset=\\"not-a-real-dir/images/this-image-already-has-a-link.jpeg, not-a-real-dir/images/this-image-already-has-a-link.jpeg\\" sizes=\\"(max-width: 650px) 100vw, 650px\\">
</span>
Expand All @@ -62,7 +62,7 @@ exports[`it leaves linked HTML img tags alone 1`] = `
exports[`it leaves single-line linked HTML img tags alone 1`] = `
"
<span class=\\"gatsby-resp-image-wrapper\\" style=\\"position: relative; display: block; ; max-width: 300px; margin-left: auto; margin-right: auto;\\">
<span class=\\"gatsby-resp-image-wrapper\\" style=\\"position: relative; display: block; max-width: 300px; margin-left: auto; margin-right: auto;\\">
<span class=\\"gatsby-resp-image-background-image\\" style=\\"padding-bottom: 133.33333333333331%; position: relative; bottom: 0; left: 0; background-image: url(&apos;url(&apos;data:image/png;base64, iVBORw)&apos;); background-size: cover; display: block;\\">
<img class=\\"gatsby-resp-image-image\\" style=\\"width: 100%; height: 100%; margin: 0; vertical-align: middle; position: absolute; top: 0; left: 0; box-shadow: inset 0px 0px 0px 400px white;\\" alt=\\"this image already has a link\\" title=\\"\\" src=\\"not-a-real-dir/images/this-image-already-has-a-link.jpeg\\" srcset=\\"not-a-real-dir/images/this-image-already-has-a-link.jpeg, not-a-real-dir/images/this-image-already-has-a-link.jpeg\\" sizes=\\"(max-width: 650px) 100vw, 650px\\">
</span>
Expand All @@ -74,7 +74,7 @@ exports[`it transforms HTML img tags 1`] = `
"
<a class=\\"gatsby-resp-image-link\\" href=\\"not-a-real-dir/image/my-image.jpeg\\" style=\\"display: block\\" target=\\"_blank\\" rel=\\"noopener\\">
<span class=\\"gatsby-resp-image-wrapper\\" style=\\"position: relative; display: block; ; max-width: 300px; margin-left: auto; margin-right: auto;\\">
<span class=\\"gatsby-resp-image-wrapper\\" style=\\"position: relative; display: block; max-width: 300px; margin-left: auto; margin-right: auto;\\">
<span class=\\"gatsby-resp-image-background-image\\" style=\\"padding-bottom: 133.33333333333331%; position: relative; bottom: 0; left: 0; background-image: url(&apos;url(&apos;data:image/png;base64, iVBORw)&apos;); background-size: cover; display: block;\\">
<img class=\\"gatsby-resp-image-image\\" style=\\"width: 100%; height: 100%; margin: 0; vertical-align: middle; position: absolute; top: 0; left: 0; box-shadow: inset 0px 0px 0px 400px white;\\" alt=\\"my image\\" title=\\"\\" src=\\"not-a-real-dir/image/my-image.jpeg\\" srcset=\\"not-a-real-dir/image/my-image.jpeg, not-a-real-dir/image/my-image.jpeg\\" sizes=\\"(max-width: 650px) 100vw, 650px\\">
</span>
Expand All @@ -96,7 +96,7 @@ exports[`it transforms images in markdown 1`] = `
<span
class=\\"gatsby-resp-image-wrapper\\"
style=\\"position: relative; display: block; ; max-width: 300px; margin-left: auto; margin-right: auto;\\"
style=\\"position: relative; display: block; max-width: 300px; margin-left: auto; margin-right: auto;\\"
>
<span
class=\\"gatsby-resp-image-background-image\\"
Expand Down
4 changes: 2 additions & 2 deletions packages/gatsby-remark-images/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ module.exports = (
<span
class="gatsby-resp-image-wrapper"
style="position: relative; display: block; ${
showCaptions ? null : options.wrapperStyle
}; max-width: ${presentationWidth}px; margin-left: auto; margin-right: auto;"
showCaptions ? `` : options.wrapperStyle
} max-width: ${presentationWidth}px; margin-left: auto; margin-right: auto;"
>
<span
class="gatsby-resp-image-background-image"
Expand Down

0 comments on commit 9944450

Please sign in to comment.