Skip to content

Ensure regex matches the exact tag.#15

Open
joshfoskett wants to merge 1 commit intomjmlio:masterfrom
TRIBUS:ensure-regex-matches-exact-tag
Open

Ensure regex matches the exact tag.#15
joshfoskett wants to merge 1 commit intomjmlio:masterfrom
TRIBUS:ensure-regex-matches-exact-tag

Conversation

@joshfoskett
Copy link
Copy Markdown

@joshfoskett joshfoskett commented Jan 28, 2021

Currently, the regex will match the beginning of the tag (e.g. <mj-image*), instead of looking for an exact match. This works fine if you're using the default MJML components. However, if you have a custom component, like mj-image-variable, it will look for <mj-image*, which means it'll match <mj-image-variable, causing issues.

Current regex:
https://regex101.com/r/OouqpK/1

Updated regex:
https://regex101.com/r/e4fEY6/1/

Currently, the regex will match the beginning of the tag (e.g. `<mj-image*`), instead of looking for an exact match. This works fine if you're using the default MJML components. However, if you have a custom component, like `mj-image-variable`, it will look for `<mj-image*`, which means it'll match `<mj-image-variable`, causing issues.
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