图像未在数据库的Summernote编辑器中显示

时间:2020-04-19 01:00:43

标签: php jquery laravel web summernote

我正在使用summernote编辑器在数据库中添加文本。我可以添加图像并添加属性文本,例如粗体,斜体等。一切正常,但存在一个问题。当我添加图像并稍后尝试编辑该文档时,它将显示base64字符串而不是实际图像。

这是我看到的

<p>test</p><p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAagAAABMCAYAAAA4ECPgAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA4JpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTM4IDc5LjE1OTgyNCwgMjAxNi8wOS8xNC0wMTowOTowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozNzBBQjE5RTc0MzcxMUU5QUQ0NEMzOUVDREE4NEVCMiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo5NTM5NkJGMzc5OUExMUU5ODYzQ0RENzY0NjA4RTFEQSIgeG1wTU06SW5zdGFuY2VJRD0ie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gbDeiahYfC3eTURi2nzZs34zQAqBttkRDjBiiC2R3d3eTUbEqrVhVde9CIdGcWs6pFX3VWYqhwAIECAIAJDuugAAAAgQIAAECgAAAAgQIAAECgAAAAgQIAAECgAAAAECgAAECgAAAAECgAAECgAAAAGixQw7gBAABajGEJ1Ff8AAAALcZXCdQgfgAAgBZjUAL1BD8AAECL8UQCdQM/AABAi3FDLyz8KbHHif2CPwAAoAX4PbHFakF9TOzXxEbwCQAANJmR75r00ayD+i2xVd9VCwAAoFktp1XfNSmaZB14kdi5xP5ITF1/k79bZ8SCXgAACIvW4P4nsX8n9s/ETiT2t8T+ZU74nwADAPjneh/LFxIbAAAAAElFTkSuQmCC" data-filename="apple signin black.png" style="width: 424px;"><br></p>

这是我编写的将文本设置为编辑器的代码。

$("#{{$item->id}}").summernote("code", "@if($item->document_desc != null){{ base64_decode($item->document_desc) }} @endif");

这是问题。我希望你们能帮助我解决这个问题。我已经在这个问题上困扰了很长时间了。

0 个答案:

没有答案