Skip to content
This repository was archived by the owner on Mar 5, 2023. It is now read-only.

Commit fb800da

Browse files
authored
Merge pull request #62 from 8fold/feed-rss
boolean attributes
2 parents c2bfe3b + 45fbadd commit fb800da

File tree

7 files changed

+12
-58
lines changed

7 files changed

+12
-58
lines changed

.github/CONTRIBUTING.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# Contributing
22

3-
Contributions are **welcome** and will be **credited**. We accept contributions via Pull Requests on [GitHub](https://github.com/8fold/laravel-provider).
3+
Contributions are **welcome** and will be **credited**. We accept contributions via Pull Requests on [GitHub](https://github.com/8fold/php-markup).
44

55
## Goals
66

7-
- A simple, flexible Service Provider and routes for common use cases
7+
- Readability over speed over cleverness.
8+
- Fail gracefully not by blowing things up.
89

910
### Overall
1011

File renamed without changes.

CONTRIBUTING.md

Lines changed: 0 additions & 40 deletions
This file was deleted.

SECURITY.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

composer.lock

Lines changed: 3 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Filters/AttrString.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ public function __invoke(array $using): string
1717

1818
return Shoop::this($using)->each(function($v, $m, &$build) {
1919
list($attr, $content) = Shoop::this($v)->divide(" ", false, 2);
20-
$build[] = "{$attr}=\"{$content}\"";
20+
$build[] = (Shoop::this($attr)->is($content)->unfold())
21+
? "{$attr}"
22+
: "{$attr}=\"{$content}\"";
2123
})->asString(" ")->prepend(" ")->unfold();
2224
}
2325
}

tests/Element/ElementTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function from_fold()
2626
'<container id="hello">',
2727
"string",
2828
14.59, // shoopified 7.17, // 5.29, // 4.56, // 4.02,
29-
436 // 433 // 427 // 426 // 401 // 397 // 394 // 393
29+
437 // 436 // 433 // 427 // 426 // 401 // 397 // 394 // 393
3030
)->unfoldUsing(
3131
Element::fold("container")->attr("id hello")->omitEndTag(true)
3232
);
@@ -158,7 +158,7 @@ public function attribute_list()
158158
public function testPage()
159159
{
160160
AssertEquals::applyWith(
161-
'<html><head><title>Hello, World!</title><style></style></head><body><img src="http://example.com" alt="A picture of the world"><p is="my-component">Hello, World!</p><my-link href="http://example.com/domination">World Domination</my-link><p>Done!</p></body></html>',
161+
'<html><head><title>Hello, World!</title><style></style></head><body><img src="http://example.com" alt="A picture of the world"><p is="my-component" required>Hello, World!</p><my-link href="http://example.com/domination">World Domination</my-link><p>Done!</p></body></html>',
162162
"string",
163163
5.71,
164164
397
@@ -175,7 +175,7 @@ public function testPage()
175175
'src http://example.com',
176176
'alt A picture of the world'
177177
),
178-
Element::fold('p', 'Hello, World!')->attr("is my-component"),
178+
Element::fold('p', 'Hello, World!')->attr("is my-component", "required required"),
179179
Element::fold("my-link", 'World Domination')
180180
->attr('href http://example.com/domination'),
181181
'<p>Done!</p>'

0 commit comments

Comments
 (0)