laravel-shortcodes icon indicating copy to clipboard operation
laravel-shortcodes copied to clipboard

How can we add multiple classes in shortcode ?

Open vipertecpro opened this issue 6 years ago • 1 comments

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

vipertecpro avatar May 02 '18 09:05 vipertecpro

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

$text = htmlspecialchars_decode($text, ENT_QUOTES);

Krishan19 avatar Oct 10 '18 07:10 Krishan19