Skip to content

Commit

Permalink
Add missing lazy expansion flag to comment extraction regex
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaudcolas committed Apr 6, 2022
1 parent 6ff68dd commit a5fa14c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/storybook-django.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const renderPattern = (endpoint, template_name, context, tags) => {
*/
export const extractDocsComment = (template) => {
const comments = template.match(
/{% comment "text\/markdown" %}\n*((.|\n)+){% endcomment %}/m,
/{% comment "text\/markdown" %}\n*((.|\n)+?){% endcomment %}/m,
);

if (comments && comments[1]) {
Expand Down
1 change: 1 addition & 0 deletions tests/storybook-django.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ describe('extractDocsComment', () => {
\`\`\`
{% endcomment %}
<div class="split-banner split-banner--home">
{% comment %}Add an initial disabled & hidden submit button so that pressing 'enter' will not submit form. Reload not required as the content is dynamically loaded.{% endcomment %}
`),
).toMatchInlineSnapshot(`
"
Expand Down

0 comments on commit a5fa14c

Please sign in to comment.