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

如果初始化编辑器之前的textarea存在数据可能出现问题 #12

Open
keijack opened this issue May 20, 2015 · 7 comments
Open

Comments

@keijack
Copy link

keijack commented May 20, 2015

用xhEditor初始化一个不为空的textarea,该textarea中存在<>等内容时,xhEditor会将这些内容转换为<>,导致本来希望在页面上显示的<>括号由于是HMTL的关键字原因而被隐藏。

@yaniswang
Copy link
Owner

你没把<>进行转义吧?

页面输 出的源代码发来看下。

发件人: Keijack [mailto:notifications@github.com]
发送时间: 2015年5月20日 17:43
收件人: yaniswang/xhEditor
主题: [xhEditor] 如果初始化编辑器之前的textarea存在数据可能出现问题 (#12)

用xhEditor初始化一个不为空的textarea,该textarea中存在<>等内容时,xhEditor会将这些内容转换为<>,导致本来希望在页面上显示的<>括号由于是HMTL的关键字原因而被隐藏。


Reply to this email directly or view it on GitHub #12 . https://github.com/notifications/beacon/AA7Oll5WQUt7iSncW1RR9pQpyZSUcMwHks5oLE6igaJpZM4Ehk3o.gif

@keijack
Copy link
Author

keijack commented May 21, 2015

很好复现的,你的网页中编写一个 textarea,里面的内容填写 <p>xxxx</p>
然后使用xhEditor初始化为编辑器,然后里面的内容很神奇的变成了

xxxx

2015-05-20 21:31 GMT+08:00 Yanis Wang notifications@github.com:

你没把<>进行转义吧?

页面输 出的源代码发来看下。

发件人: Keijack [mailto:notifications@github.com]
发送时间: 2015年5月20日 17:43
收件人: yaniswang/xhEditor
主题: [xhEditor] 如果初始化编辑器之前的textarea存在数据可能出现问题 (#12)

用xhEditor初始化一个不为空的textarea,该textarea中存在<>等内容时,xhEditor会将这些内容转换为<>,导致本来希望在页面上显示的<>括号由于是HMTL的关键字原因而被隐藏。


Reply to this email directly or view it on GitHub <
https://github.com/yaniswang/xhEditor/issues/12> . <
https://github.com/notifications/beacon/AA7Oll5WQUt7iSncW1RR9pQpyZSUcMwHks5oLE6igaJpZM4Ehk3o.gif>


Reply to this email directly or view it on GitHub
#12 (comment).

Keijack

@yaniswang
Copy link
Owner

按照你这种说法,应该是正确的。

你之前不是说

被隐藏了?

但是按照你刚刚的说法,是正确显示的。

发件人: Keijack [mailto:notifications@github.com]
发送时间: 2015年5月21日 23:20
收件人: yaniswang/xhEditor
抄送: Yanis Wang
主题: Re: [xhEditor] 如果初始化编辑器之前的textarea存在数据可能出现问题 (#12)

很好复现的,你的网页中编写一个 textarea,里面的内容填写 <p>xxxx</p>
然后使用xhEditor初始化为编辑器,然后里面的内容很神奇的变成了

xxxx

2015-05-20 21:31 GMT+08:00 Yanis Wang <notifications@github.com mailto:notifications@github.com >:

你没把<>进行转义吧?

页面输 出的源代码发来看下。

发件人: Keijack [mailto:notifications@github.com]
发送时间: 2015年5月20日 17:43
收件人: yaniswang/xhEditor
主题: [xhEditor] 如果初始化编辑器之前的textarea存在数据可能出现问题 (#12)

用xhEditor初始化一个不为空的textarea,该textarea中存在<>等内容时,xhEditor会将这些内容转换为<>,导致本来希望在页面上显示的<>括号由于是HMTL的关键字原因而被隐藏。


Reply to this email directly or view it on GitHub <
https://github.com/yaniswang/xhEditor/issues/12> . <
https://github.com/notifications/beacon/AA7Oll5WQUt7iSncW1RR9pQpyZSUcMwHks5oLE6igaJpZM4Ehk3o.gif>


Reply to this email directly or view it on GitHub
#12 (comment).

Keijack


Reply to this email directly or view it on GitHub #12 (comment) . https://github.com/notifications/beacon/AA7OlsE3RO4xyScTC7qeP5OS6tfTLr0dks5oLe8mgaJpZM4Ehk3o.gif

@keijack
Copy link
Author

keijack commented May 22, 2015

这是你的例子,我在根目录下加了个文件xx.html,你运行一下就知道了。我说的变成

xxxx

是源代码级别的,在编辑器上看到的只有 xxxx

2015-05-22 8:34 GMT+08:00 Yanis Wang notifications@github.com:

按照你这种说法,应该是正确的。

你之前不是说

被隐藏了?

但是按照你刚刚的说法,是正确显示的。

发件人: Keijack [mailto:notifications@github.com]
发送时间: 2015年5月21日 23:20
收件人: yaniswang/xhEditor
抄送: Yanis Wang
主题: Re: [xhEditor] 如果初始化编辑器之前的textarea存在数据可能出现问题 (#12)

很好复现的,你的网页中编写一个 textarea,里面的内容填写 <p>xxxx</p>
然后使用xhEditor初始化为编辑器,然后里面的内容很神奇的变成了

xxxx

2015-05-20 21:31 GMT+08:00 Yanis Wang <notifications@github.com <mailto:
notifications@github.com> >:

你没把<>进行转义吧?

页面输 出的源代码发来看下。

发件人: Keijack [mailto:notifications@github.com]
发送时间: 2015年5月20日 17:43
收件人: yaniswang/xhEditor
主题: [xhEditor] 如果初始化编辑器之前的textarea存在数据可能出现问题 (#12)

用xhEditor初始化一个不为空的textarea,该textarea中存在<>等内容时,xhEditor会将这些内容转换为<>,导致本来希望在页面上显示的<>括号由于是HMTL的关键字原因而被隐藏。


Reply to this email directly or view it on GitHub <
https://github.com/yaniswang/xhEditor/issues/12> . <

https://github.com/notifications/beacon/AA7Oll5WQUt7iSncW1RR9pQpyZSUcMwHks5oLE6igaJpZM4Ehk3o.gif>


Reply to this email directly or view it on GitHub
#12 (comment).

Keijack


Reply to this email directly or view it on GitHub <
https://github.com/yaniswang/xhEditor/issues/12#issuecomment-104317181> .
<
https://github.com/notifications/beacon/AA7OlsE3RO4xyScTC7qeP5OS6tfTLr0dks5oLe8mgaJpZM4Ehk3o.gif>


Reply to this email directly or view it on GitHub
#12 (comment).

Keijack

@keijack
Copy link
Author

keijack commented May 22, 2015

另,我的浏览器是 linux 下的 firefox 38.0.1 (64bit)

2015-05-22 8:34 GMT+08:00 Yanis Wang notifications@github.com:

按照你这种说法,应该是正确的。

你之前不是说

被隐藏了?

但是按照你刚刚的说法,是正确显示的。

发件人: Keijack [mailto:notifications@github.com]
发送时间: 2015年5月21日 23:20
收件人: yaniswang/xhEditor
抄送: Yanis Wang
主题: Re: [xhEditor] 如果初始化编辑器之前的textarea存在数据可能出现问题 (#12)

很好复现的,你的网页中编写一个 textarea,里面的内容填写 <p>xxxx</p>
然后使用xhEditor初始化为编辑器,然后里面的内容很神奇的变成了

xxxx

2015-05-20 21:31 GMT+08:00 Yanis Wang <notifications@github.com <mailto:
notifications@github.com> >:

你没把<>进行转义吧?

页面输 出的源代码发来看下。

发件人: Keijack [mailto:notifications@github.com]
发送时间: 2015年5月20日 17:43
收件人: yaniswang/xhEditor
主题: [xhEditor] 如果初始化编辑器之前的textarea存在数据可能出现问题 (#12)

用xhEditor初始化一个不为空的textarea,该textarea中存在<>等内容时,xhEditor会将这些内容转换为<>,导致本来希望在页面上显示的<>括号由于是HMTL的关键字原因而被隐藏。


Reply to this email directly or view it on GitHub <
https://github.com/yaniswang/xhEditor/issues/12> . <

https://github.com/notifications/beacon/AA7Oll5WQUt7iSncW1RR9pQpyZSUcMwHks5oLE6igaJpZM4Ehk3o.gif>


Reply to this email directly or view it on GitHub
#12 (comment).

Keijack


Reply to this email directly or view it on GitHub <
https://github.com/yaniswang/xhEditor/issues/12#issuecomment-104317181> .
<
https://github.com/notifications/beacon/AA7OlsE3RO4xyScTC7qeP5OS6tfTLr0dks5oLe8mgaJpZM4Ehk3o.gif>


Reply to this email directly or view it on GitHub
#12 (comment).

Keijack

@keijack
Copy link
Author

keijack commented May 22, 2015

<title>xhEditor Test</title> <script type="text/javascript" src="jquery/jquery-1.4.4.min.js"></script> <script type="text/javascript" src="xheditor-1.2.2.min.js"></script> <script type="text/javascript" src="xheditor_lang/zh-cn.js"></script> <script type="text/javascript"> $(function () { $('textarea[name=preview]').attr("id", "xx").xheditor({ }); }); </script>
<textarea id="preview" name="preview" rows="8" cols="120"><p>xxxxx</p></textarea>

2015-05-22 10:05 GMT+08:00 Keijack Wu keijack.wu@gmail.com:

另,我的浏览器是 linux 下的 firefox 38.0.1 (64bit)

2015-05-22 8:34 GMT+08:00 Yanis Wang notifications@github.com:

按照你这种说法,应该是正确的。

你之前不是说

被隐藏了?

但是按照你刚刚的说法,是正确显示的。

发件人: Keijack [mailto:notifications@github.com]
发送时间: 2015年5月21日 23:20
收件人: yaniswang/xhEditor
抄送: Yanis Wang
主题: Re: [xhEditor] 如果初始化编辑器之前的textarea存在数据可能出现问题 (#12)

很好复现的,你的网页中编写一个 textarea,里面的内容填写 <p>xxxx</p>
然后使用xhEditor初始化为编辑器,然后里面的内容很神奇的变成了

xxxx

2015-05-20 21:31 GMT+08:00 Yanis Wang <notifications@github.com <mailto:
notifications@github.com> >:

你没把<>进行转义吧?

页面输 出的源代码发来看下。

发件人: Keijack [mailto:notifications@github.com]
发送时间: 2015年5月20日 17:43
收件人: yaniswang/xhEditor
主题: [xhEditor] 如果初始化编辑器之前的textarea存在数据可能出现问题 (#12)

用xhEditor初始化一个不为空的textarea,该textarea中存在<>等内容时,xhEditor会将这些内容转换为<>,导致本来希望在页面上显示的<>括号由于是HMTL的关键字原因而被隐藏。


Reply to this email directly or view it on GitHub <
https://github.com/yaniswang/xhEditor/issues/12> . <

https://github.com/notifications/beacon/AA7Oll5WQUt7iSncW1RR9pQpyZSUcMwHks5oLE6igaJpZM4Ehk3o.gif>


Reply to this email directly or view it on GitHub
#12 (comment).

Keijack


Reply to this email directly or view it on GitHub <
https://github.com/yaniswang/xhEditor/issues/12#issuecomment-104317181>
. <
https://github.com/notifications/beacon/AA7OlsE3RO4xyScTC7qeP5OS6tfTLr0dks5oLe8mgaJpZM4Ehk3o.gif>


Reply to this email directly or view it on GitHub
#12 (comment).

Keijack

Keijack

@yaniswang
Copy link
Owner

这个结果是正确的。

你可以尝试不要加载xhEditor,看看原始的textarea是什么样的结果。

这个结果和xhEditor中的源代码模式是一样的。

xhEditor的可视化模式是用来辅助编辑你的源代码的,所以可视状态下看不到

是正常的。

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

No branches or pull requests

2 participants