How i can display the correct url for the image uploaded using TinyMCE?
I get a file not found error, this because when I load the created contents on the frontend, the src
attribute of the images contained inside the post are referring to my img path like this ../../img/prt/image.jpg
, and it's the correct path for the backend, but from the index i need that the src is set to img/prt/image.jpg
that is the correct path. Any suggestion?
![](https://profile-avatar.csdnimg.cn/default.jpg!4)
TinyMCE从前端显示正确的图像路径
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
1条回答 默认 最新
- dsfhe34889 2018-09-21 04:41关注
I've found a solution for this. After reading the related section of the documentations, I've solved using the
convert_urls
option of the editor. This is the third time I use this kind of editor, so I didn't know about all available options.https://www.tiny.cloud/docs/configure/url-handling/#convert_urls
example code:
$(document).ready(function(){ tinymce.init({ selector: 'textarea', // change this value according to your HTML convert_urls: false }); });
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报