Skip to content

Commit

Permalink
Fix snippet parser regex as per #28
Browse files Browse the repository at this point in the history
  • Loading branch information
Fl0Cri committed Apr 11, 2024
1 parent f286044 commit b31e13d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion classes/SnippetParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ protected static function extractSnippetsFromMarkup($markup, $theme)
: $value;
};

if (preg_match_all('#<figure\s+.+>[^<>]*</figure>#i', $markup, $matches)) {
if (preg_match_all('#<figure\s+.+?>[^<>]*</figure>#i', $markup, $matches)) {
foreach ($matches[0] as $snippetDeclaration) {
$nameMatch = [];

Expand Down
2 changes: 2 additions & 0 deletions updates/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@
- Updated snippets parser (now using the same as OC 3.5), should be a bit faster and support some additional features
2.2.1:
- Support for basic HTML in snippet properties - Thanks @grwllrnc
2.2.2:
- Fix some cases where content between two snippets could be stripped

0 comments on commit b31e13d

Please sign in to comment.