UEditor icon indicating copy to clipboard operation
UEditor copied to clipboard

插入代码,会导致页面无法显示

Open datangkang123 opened this issue 5 years ago • 5 comments

博客使用这编辑器插入一些代码,比如js,会导致页面执行该js而无法显示页面。

datangkang123 avatar Oct 04 '19 22:10 datangkang123

具体是什么内容呢,方便发一下么?

我试着加入了js代码,没发现有执行或报错

codingyu avatar Oct 08 '19 12:10 codingyu

比如如下js代码,插入后,在文章显示页无法显示: js代码下载

datangkang123 avatar Oct 08 '19 12:10 datangkang123

@datangkang123 禁用 pjax 可以解决 ,https://laravel-admin.org/docs/zh/qa#可以关掉pjax吗?

codingyu avatar Oct 09 '19 02:10 codingyu

@codingyu 插入php代码也有些问题,比如 ` <?php

namespace App\Policies;

use Illuminate\Auth\Access\HandlesAuthorization; use App\Models\User;

class UserPolicy { use HandlesAuthorization;

public function update(User $currentUser, User $user)
{
    return $currentUser->id === $user->id;
}

}`

插入后,再编辑时,会丢失代码。

datangkang123 avatar Oct 09 '19 02:10 datangkang123

嗯,< > 符号的问题, 找到一个方式 https://www.reinforce.cn/t/645.html ,我再看看有没有别的办法解决

codingyu avatar Oct 09 '19 12:10 codingyu