Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add additional class for icons #281

Merged
merged 3 commits into from
Aug 6, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Twig/BootstrapIconExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function parseIconsFilter($text)
{
$that = $this;
return preg_replace_callback(
'/\.icon-([a-z0-9-]+)/',
'/\.icon-([a-z0-9+-]+)/',
function ($matches) use ($that) {
return $that->iconFunction($matches[1]);
},
Expand All @@ -88,6 +88,8 @@ function ($matches) use ($that) {
*/
public function iconFunction($icon)
{
$icon = str_replace('+', ' '.$this->iconPrefix.'-', $icon);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add an empty line after this one to conform with PSR-2.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added it


return sprintf('<span class="%1$s %1$s-%2$s"></span>', $this->iconPrefix, $icon);
}

Expand Down