Closed daomapsieucap closed 1 year ago
Suggest solutions:
@daomapsieucap Have issue convert email with regex. When element with a email structure attribute, and only 1 element is added on page. All content will not be wrapped with \
tag. So $att_email_regex regex not work. When there are more than 2 elements, all content will be wrapped with \
tag. But there is a problem if the element has more attributes, the regex doesn't work correctly
When the regex doesn't work correctly, the email structure attribute will be replaced with email link. Lead to incorrect email extraction results.
I updated my code for function fiad_auto_convert_email_address. Demo on the lab site with Team List component. Please see demo on test bug convert email page and revise my code on the Lab site.
Link test Regex and preg_match:
https://regex101.com/r/1jhgsF/1 https://www.phpliveregex.com/p/IfC
@phongkhuu115 Could you help to check the case mentioned above?
Convert Email Text to Link now converts all content using hook
the_content
which makes the wrong HTML structure in thedata-
attribute.To prevent this issue, I think the feature Convert Email Text needs to use regex to prevent converting text in the
data-
attribute.