Skip to content
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

Non greedy regexp if multiple embeds on same line #4663

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions scripts/core/editor3/html/from-html/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ class HTMLParser {

manageEmbeds(__html: string): string {
let html = __html;
const embedCount = html.match(/<!-- EMBED START.*-->/g)?.length ?? 0;
const embedCount = html.match(/<!-- EMBED START.*?-->/g)?.length ?? 0;

for (let i = 0; i < embedCount; i++) {
const startTag = html.match(/<!-- EMBED START.*-->/);
const endTag = html.match(/<!-- EMBED END.*-->/);
const startTag = html.match(/<!-- EMBED START.*?-->/);
const endTag = html.match(/<!-- EMBED END.*?-->/);

if (startTag == null || endTag == null) {
continue;
Expand Down
Loading