webwizo / laravel-shortcodes

Wordpress like shortcodes for Laravel 4.2, 5.x, 6.x, 7.x, 8.x, 9.x and 10.x
MIT License
214 stars 49 forks source link

attribute having space value converts to weird array. #56

Open hardikdangar opened 4 years ago

hardikdangar commented 4 years ago

I.e. [pdfmodal path=/files/docs_5eebb3f1b4e595.53497870.pdf modaltitle='Flat Rate Cost']Click Here[/pdfmodal]

see the argument modaltitle it becomes weird object...

Returns

Shortcode {#1455 ▼
  #name: "pdfmodal"
  #attributes: array:4 [▼
    "path" => "/files/docs_5eebb3f1b4e595.53497870.pdf"
    "modaltitle" => "'Flat"
    0 => "Rate"
    1 => "Cost'"
  ]
  +content: "Click Here"
}

How to prevent that? how to allow spaces in attribute values.

webwizo commented 4 years ago

It should work, I think you have forgot to contain path in quotes, that's why it is affecting next attribute.

[pdfmodal path="/files/docs_5eebb3f1b4e595.53497870.pdf" modaltitle="Flat Rate Cost"]Click Here[/pdfmodal]

Can you try this?