I
I
igorc752019-05-11 14:19:49
JavaScript
igorc75, 2019-05-11 14:19:49

Can TinyMCE remove caption="false" from images?

When loading a picture, the TinyMCE editor adds a property: caption="false" - which, as it were, prohibits the display of a caption for the picture.

<img src="../source/statii/1557572548892.jpg" class="img-fluid" width="1012" height="505" caption="false" />

The manual says that you can disable: image_caption: true to false
But I tried nothing changes.
I would like to get rid of it altogether, which one I need in the tag.
Can someone tell me how to remove it from the entire site using JS when it is displayed?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Shohruh Shaimardonov, 2019-05-11
@joeberetta

You can remove an attribute.

allImages = document.querySelectorAll('img.img-fluid')
for(let i=0; i<allImages.length; i++)
  allImages[i].removeAttribute('caption')

But still this is not the best solution, but the answer to the question:
Can someone tell me how to remove it from the entire site using JS when shown?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question