refactory-id / bootstrap-markdown

Bootstrap plugin for markdown editing
Apache License 2.0
1.99k stars 371 forks source link

Array for data-hidden-buttons? #154

Closed mwsasser closed 7 years ago

mwsasser commented 9 years ago

Shouldn't this work in the textarea tag?

data-hidden-buttons="['cmdImage','cmdUrl']"

I'm only a hobby developer so it's possible I'm misunderstanding how to put an array into the tag properly. But I have tried these also:

data-hidden-buttons="[cmdImage,cmdUrl]" data-hidden-buttons="'cmdImage','cmdUrl'" data-hidden-buttons="cmdImage,cmdUrl"

abelorian commented 9 years ago

+1 . Only know: data-hidden-buttons="all"

mwsasser commented 9 years ago

I only want to hide the url and image. But any information on how to put it in an array properly would be nice.

phenyll commented 9 years ago

In case this Question is still relevant:

you can use data-hidden-buttons='["cmdHeading","cmdImage"]' seen here: http://stackoverflow.com/a/6071653/936304

this is because this plugin is using standard jquery calls to parse the settings. you can find the code here: https://github.com/toopay/bootstrap-markdown/blob/master/js/bootstrap-markdown.js#L36

A link or example in the documentation yould have saved me an hour of searching too..

nicklayb commented 7 years ago

You don't need to put an array. I searched in the source as I was looking for the same feature and it appears that it splits the value by space " ". So you can just do it that way :

data-hidden-buttons="cmdPreview cmdHeading"

lodev09 commented 7 years ago

I think this will work if you want a "proper" html format: data-hidden-buttons="["cmdHeading","cmdImage"]"

Basically the value should be in JSON format so it needs quotes :)