-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add preview element #1676
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it, love it
encoding: 'utf8', | ||
}); | ||
|
||
const regex = /\/\/\s*<preview>([\s\S]*?)\/\/\s*<\/preview>/; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Between preview
comments this matches on white-space and non-white-space – effectively anything (visualisation)
Could we make it a little simpler with?
/\/\/\s*<preview>(.*?)\/\/\s*<\/preview>/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's a very tiny detail that people might miss and let's why I included it so if someone doesn't use space between comments than it will still work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're talking about different things. My point was we could write ([\s\S]*?)
as (.*?)
and I believe get the same result
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh i see :D sorry i thought you meant different thing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actualllllllyyy.... it looks like .
doesn't capture line breaks where \s\S
I think will, that's something to watch out for, maybe ignore this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 🚀 🚀 🚀 🚀 🚀
Describe your changes
Add preview component for astro web page
Issue ticket number and link
OR-717
Checklist before requesting a review