Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

符号&在公式编辑块里显示不正确,katex、math、latex标签均无效 #213

Open
huiyuyu opened this issue Jan 19, 2018 · 4 comments

Comments

@huiyuyu
Copy link

huiyuyu commented Jan 19, 2018

windows 10,php 7.2,nginx 1.13.8,showdoc 1.8.6
在编辑页面内,预期打印运算符&,以如下格式插入公式,

```katex
\&
```

预览显示为

&

保存后在查看页面中显示为

&

尝试过
\& \& &amps;
均无法达到预期显示

katex标签替换为math、latex也一样

@star7th
Copy link
Owner

star7th commented Jan 19, 2018

初步看了下,此问题好像暂时没啥方法。
因为跟一些安全关键字冲突了。而为了安全,增加了一些转义规则。
我一时没找到思路。

@breakXML
Copy link

初步看了下,此问题好像暂时没啥方法。
因为跟一些安全关键字冲突了。而为了安全,增加了一些转义规则。
我一时没找到思路。

  1. 同样碰到过这个问题,调试过,发现是&符号在 I("content"), 这里获取参数失败,框架上不爱动所以动了showdoc_api.sh
    2.对每个参数都做url_encode进行转换即可,我在自动生成脚本showdoc_api.sh上小改了一下
    image

@star7th
Copy link
Owner

star7th commented May 22, 2019

@breakXML 你这样方式是想url_encode传输到服务器,然后在服务器解码存数据库吗?这种方式等于绕过了安全过滤吧

@star7th
Copy link
Owner

star7th commented May 22, 2019

@breakXML 直接绕过安全过滤能解决问题但也会引入安全问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants