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

How can we add multiple classes in shortcode ? #27

Open
vipertecpro opened this issue May 2, 2018 · 1 comment
Open

How can we add multiple classes in shortcode ? #27

vipertecpro opened this issue May 2, 2018 · 1 comment

Comments

@vipertecpro
Copy link

vipertecpro commented May 2, 2018

I've registered this
Shortcode::register('colmd3', 'App\Shortcodes\ColumnShortcode@colmd3'); into my ShortcodesServiceProvider
while applying it's working fine

[colmd3 class="col-sm-4"]
[/colmd3]

but extra class is not applying

[colmd3 class="col-sm-4 text-center"]
[/colmd3]

This is my ColumnShortcode provider

class ColumnShortcode 
{
  public function colmd3($shortcode, $content)
  {
    return sprintf('<div class = "col-md-3 %s">%s</div>', $shortcode->class, $content);
  }
}

Please help, Thank you

@Krishan19
Copy link
Contributor

update src/Compilers/ShortcodeCompiler.php class "parseAttributes" method

$text = htmlspecialchars_decode($text, ENT_QUOTES);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants