Skip to content
This repository has been archived by the owner on Nov 11, 2024. It is now read-only.

Commit

Permalink
fix: variable interpolation
Browse files Browse the repository at this point in the history
allow for variables to be interpolated mid-sentence

fixes #101
  • Loading branch information
SwiftWinds committed Nov 15, 2021
1 parent 6d2bf1d commit 8ee0e0e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ const stripIndent = require('strip-indent')
module.exports = (css, settings) => {
const cssWithPlaceholders = css
.replace(
/%%styled-jsx-placeholder-(\d+)%%%(\w*\s*[),;!{])/g,
/%%styled-jsx-placeholder-(\d+)%%%(\w*[ ),;!{])/g,
(_, id, p1) => `styled-jsx-percent-placeholder-${id}-${p1}`
)
.replace(
/%%styled-jsx-placeholder-(\d+)%%(\w*\s*[),;!{])/g,
/%%styled-jsx-placeholder-(\d+)%%(\w*[ ),;!{])/g,
(_, id, p1) => `styled-jsx-placeholder-${id}-${p1}`
)
.replace(
Expand All @@ -33,11 +33,11 @@ module.exports = (css, settings) => {

return preprocessed
.replace(
/styled-jsx-percent-placeholder-(\d+)-(\w*\s*[),;!{])/g,
/styled-jsx-percent-placeholder-(\d+)-(\w*[ ),;!{])/g,
(_, id, p1) => `%%styled-jsx-placeholder-${id}%%%${p1}`
)
.replace(
/styled-jsx-placeholder-(\d+)-(\w*\s*[),;!{])/g,
/styled-jsx-placeholder-(\d+)-(\w*[ ),;!{])/g,
(_, id, p1) => `%%styled-jsx-placeholder-${id}%%${p1}`
)
.replace(
Expand Down

0 comments on commit 8ee0e0e

Please sign in to comment.