From 6830c3339f70046183280ceaba83bcbc5c60634b Mon Sep 17 00:00:00 2001 From: Aidan Woods Date: Fri, 9 Mar 2018 17:38:41 +0000 Subject: [PATCH] Readability Thanks @PhrozenByte for the suggestion :) --- Parsedown.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Parsedown.php b/Parsedown.php index 27a35bf..c0dbf08 100644 --- a/Parsedown.php +++ b/Parsedown.php @@ -1142,10 +1142,10 @@ class Parsedown protected function inlineEmailTag($Excerpt) { - $commonMarkEmail = '[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]++@[a-zA-Z0-9]' - .'(?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?' - .'(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*' - ; + $hostnameLabel = '[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?'; + + $commonMarkEmail = '[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]++@' + . $hostnameLabel . '(?:\.' . $hostnameLabel . ')*'; if (strpos($Excerpt['text'], '>') !== false and preg_match("/^<((mailto:)?$commonMarkEmail)>/i", $Excerpt['text'], $matches)