mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-13 11:37:46 +02:00
feat(plugins): add aside with plugin metadata next to plugin's readme
- enhance plugin card ui - refactor components to be more consistent - invert toggler label for better UX - edit view components regex
This commit is contained in:
parent
e6bfdfc390
commit
dfb7888aeb
193 changed files with 1630 additions and 1346 deletions
|
|
@ -43,38 +43,38 @@ class ComponentRenderer
|
|||
private function renderSelfClosingTags(string $output): string
|
||||
{
|
||||
// Pattern borrowed and adapted from Laravel's ComponentTagCompiler
|
||||
// Should match any Component tags <Component />
|
||||
// Should match any Component tags <x-Component />
|
||||
$pattern = "/
|
||||
<
|
||||
\s*
|
||||
(?<name>[A-Z][A-Za-z0-9\.]*?)
|
||||
\s*
|
||||
\\s*
|
||||
x[-\\:](?<name>[\\w\\-\\:\\.]*)
|
||||
\\s*
|
||||
(?<attributes>
|
||||
(?:
|
||||
\s+
|
||||
\\s+
|
||||
(?:
|
||||
(?:
|
||||
\{\{\s*\\\$attributes(?:[^}]+?)?\s*\}\}
|
||||
\\{\\{\\s*\\\$attributes(?:[^}]+?)?\\s*\\}\\}
|
||||
)
|
||||
|
|
||||
(?:
|
||||
[\w\-:.@]+
|
||||
[\\w\\-:.@]+
|
||||
(
|
||||
=
|
||||
(?:
|
||||
\\\"[^\\\"]*\\\"
|
||||
|
|
||||
\'[^\']*\'
|
||||
\\'[^\\']*\\'
|
||||
|
|
||||
[^\'\\\"=<>]+
|
||||
[^\\'\\\"=<>]+
|
||||
)
|
||||
)?
|
||||
)
|
||||
)
|
||||
)*
|
||||
\s*
|
||||
\\s*
|
||||
)
|
||||
\/>
|
||||
\\/>
|
||||
/x";
|
||||
|
||||
/*
|
||||
|
|
@ -96,8 +96,9 @@ class ComponentRenderer
|
|||
|
||||
private function renderPairedTags(string $output): string
|
||||
{
|
||||
$pattern = '/<\s*(?<name>[A-Z][A-Za-z0-9\.]*?)(?<attributes>(\s*[\w\-]+\s*=\s*(\'[^\']*\'|\"[^\"]*\"))+\s*)>(?<slot>.*)<\/\s*\1\s*>/uUsm';
|
||||
ini_set('pcre.backtrack_limit', '-1');
|
||||
// ini_set('pcre.backtrack_limit', '-1');
|
||||
$pattern = '/<\s*x[-\:](?<name>[\w\-\:\.]*?)(?<attributes>(\s*[\w\-]+\s*=\s*(\'[^\']*\'|\"[^\"]*\"))+\s*)>(?<slot>.*)<\/\s*x-\1\s*>/uiUsm';
|
||||
|
||||
/*
|
||||
$matches[0] = full tags matched and all of its content
|
||||
$matches[name] = pascal cased tag name
|
||||
|
|
@ -167,8 +168,6 @@ class ComponentRenderer
|
|||
(
|
||||
\"[^\"]+\"
|
||||
|
|
||||
\'[^\']+\'
|
||||
|
|
||||
\\\'[^\\\']+\\\'
|
||||
|
|
||||
[^\s>]+
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue