steveathon / bootstrap-wysiwyg

Tiny bootstrap-compatible WYSIWYG rich text editor
MIT License
663 stars 1.71k forks source link

Figure and figcaption support #5

Open wouter-leistra opened 10 years ago

wouter-leistra commented 10 years ago

Can by inserting/uploading an image the figure tag including the figcaption tag be inserted/edited? I'm looking for a structure of:

image

I'm not sure if i have used this version or the mindmup original version but if i enter this structure in the HTMLedit the figure and figcaption tags are replaced by divs and are therefore not editable anymore after switching back to WYSIWYG mode.

Any ideas how to get this working is appreciated!

steveathon commented 10 years ago

It's entirely possible that the convert from source to WYSIWYG is switching the tags out for some reason on the older version.

On this one, if you look at the HTML-Editor example, it seems to be ok, by entering the above (with an image link). Switching between the two seems to keep the formatting. Be aware, there is a bug with only having an image only, without any text - for some reason the CleanHTML command kills any image, but it wont switch it to a div, just kills it.

Check the latest version here and the examples and let me know if that fixes it or not, I'll do some digging and see what else it could be.

wouter-leistra commented 10 years ago

I can insert it and indeed it stays as entered in the HMTL editor, however the inserted image is not editable at all i could not replace the image other than removing the current image and inserting a new one but this will be put in DIVs rather than in the same figure tag. But maybe some functions need to be adjusted in order to make it work the way i would like it to work.

After some exploring in the SRC file i also cannot find the location where to possibly adjust it either, i will have to dig into it a bit deeper...

imskull commented 10 years ago

In my Chrome33, I disabled dragAndDropImages option, I can replace image now. or if you still want dragAndDropImages available, remove "editor.on('dragenter dragover', false)", it works as well, but I don't if there is some side effect by removing this line.