Skip to content

Non greedy regexp if multiple embeds on same line#4663

Open
antonborgstrom wants to merge 1 commit into
superdesk:developfrom
antonborgstrom:fix/regex_in_manage_embeds
Open

Non greedy regexp if multiple embeds on same line#4663
antonborgstrom wants to merge 1 commit into
superdesk:developfrom
antonborgstrom:fix/regex_in_manage_embeds

Conversation

@antonborgstrom

Copy link
Copy Markdown
Contributor

What does this MR do?

  • Fixes the regex-pattern in manageEmbeds() so it will only match one embed-group at a time.

When parsing embeds from ingest feed, if html is printed on same row .* will match everything from the first <!-- EMBED START to the last --> in the string, capturing everything in between.

By using .*?, it will stop at the first occurrence of --> rather than the last and it will only match one pair at a time if the html is compressed into single line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant