From b3f085c27d61497fcd4f815ec427302fdac6096e Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Fri, 9 Jan 2015 07:15:16 -0700 Subject: [PATCH] Support markdown extra classes on lightbox --- system/src/Grav/Common/Markdown/MarkdownGravLinkTrait.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/system/src/Grav/Common/Markdown/MarkdownGravLinkTrait.php b/system/src/Grav/Common/Markdown/MarkdownGravLinkTrait.php index f3ea22dc17..6242ef01c0 100644 --- a/system/src/Grav/Common/Markdown/MarkdownGravLinkTrait.php +++ b/system/src/Grav/Common/Markdown/MarkdownGravLinkTrait.php @@ -94,7 +94,6 @@ protected function identifyLink($Excerpt) if (!isset($actions['lightbox']) && !is_array($src)) { $Excerpt['element']['attributes']['src'] = $src; } else { - // Create the custom lightbox element $Element = array( 'name' => 'a', @@ -106,6 +105,11 @@ protected function identifyLink($Excerpt) ), ); + // Set any custom classes on the lightbox element + if (isset($Excerpt['element']['attributes']['class'])) { + $Element['attributes']['class'] = $Excerpt['element']['attributes']['class']; + } + // Set the lightbox element on the Excerpt $Excerpt['element'] = $Element; }