fix: correct prettier placeholder regex (#4302)

master
Evilebot Tnawi 2018-04-12 18:25:25 +03:00 committed by GitHub
parent bdc5e0073d
commit 47cb5ad298
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 1 deletions

View File

@ -283,7 +283,7 @@ function replacePlaceholders(quasisDoc, expressionDocs) {
const placeholder = parts[atPlaceholderIndex];
const rest = parts.slice(atPlaceholderIndex + 1);
const placeholderMatch = placeholder.match(
/@prettier-placeholder-(.+)-id(.*)/
/@prettier-placeholder-(.+)-id([\s\S]*)/
);
const placeholderID = placeholderMatch[1];
// When the expression has a suffix appended, like:

View File

@ -66,6 +66,13 @@ styled.div\`
\${props => props.red ? 'color: red;' : ''};
/* prettier-ignore */
\`
styled.div\`
\${sanitize} \${fonts}
html {
margin: 0;
}
\`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const ListItem = styled.li\`\`;
@ -136,4 +143,11 @@ styled.div\`
/* prettier-ignore */
\`;
styled.div\`
\${sanitize} \${fonts}
html {
margin: 0;
}
\`;
`;

View File

@ -63,3 +63,10 @@ styled.div`
${props => props.red ? 'color: red;' : ''};
/* prettier-ignore */
`
styled.div`
${sanitize} ${fonts}
html {
margin: 0;
}
`