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

[html] 第139天 如何让textarea标签中的内容原格式输出? #1140

Open
haizhilin2013 opened this issue Sep 1, 2019 · 5 comments
Labels
html html

Comments

@haizhilin2013
Copy link
Collaborator

第139天 如何让textarea标签中的内容原格式输出?

@haizhilin2013 haizhilin2013 added the html html label Sep 1, 2019
@nowherebutup
Copy link

nowherebutup commented Sep 2, 2019

<textarea name="demo" id="" cols="30" rows="10">
   <code>
     <span>
       <i></i>
     </span>
     <div></div>
   </code>
 </textarea>

@xiangshuo1992
Copy link
Contributor

white-space: pre;可以考虑

@467827183
Copy link

replace正则检测格式然后用对应的标签进行替换,感觉挺符合标题的

@ShuiXinSuoYu
Copy link

输出?是转成html,在编译成dom?

@liuam007
Copy link

liuam007 commented Sep 3, 2019

不知道是不是我理解错误了,
<textarea name="demo" id="" cols="30" rows="10"> dfjsk fsdfsd sdfsdfs sdf sdfsdfs </textarea>

直接这样也可以原样输出

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

No branches or pull requests

6 participants