I have uploaded an image via TinyMCE to display in an announcement on the website. In the editor I scaled the image and can see in the editor source that the width and height attributes are being set correctly. On the frontend however when the announcement is being viewed, the image is not being scaled - it is being shown at full-size and with no width or height attributes at all.
Is TinyMCE stripping the width and height attributes from the img links??
Steps I took leading up to the issue:
Inserted an image into the TinyMCE editor as part of a new announcement record to be shown on the frontend.
What I tried to resolve the issue:
Nothing I do appears to correct the width and height of the inserted image.
Application Version - e.g., OJS 3.1.2:
OJS 3.3.0.10
Additional information, such as screenshots and error log messages if applicable:
The width and height are visible in the editor.
On the frontend, the image html looks like:
<img src="http://localhost/ojs/public/site/images/aforshaw/wrong-issue.png" alt="An image from the disk">
Could this be a setting within TinyMCE, or something to do with OJS itself?
Do you have Text Editor extras plugin installed (and announcements checked off in the settings)? That might allow you to bypass the stripping out of the HTML - not certain - but worth a try.
But I wonder about some potential workarounds here:
You could try editing your config.inc.php to have some additional allowed HTML:
allowed_html = "a[href|target|title],em,strong,cite,code,ul,ol,li[class],dl,dt,dd,b,i,u,img[src|alt|width|height],sup,sub,br,p (this is just an example I pulled - your settings might look different)
Another option to try might be a custom stylesheet CSS stylesheet, where you identify the image through an ID attribute. That said, even if you had an ID attribute - although - it’s entirely possible that if you used an id or something similar in the HTML, that it would be stripped out.