Skip to content

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

Open
@haizhilin2013

Description

@haizhilin2013

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

Activity

nowherebutup

nowherebutup commented on Sep 2, 2019

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

xiangshuo1992 commented on Sep 2, 2019

@xiangshuo1992
Contributor

white-space: pre;可以考虑

467827183

467827183 commented on Sep 3, 2019

@467827183

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

ShuiXinSuoYu

ShuiXinSuoYu commented on Sep 3, 2019

@ShuiXinSuoYu

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

liuam007

liuam007 commented on Sep 3, 2019

@liuam007

不知道是不是我理解错误了,
<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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @haizhilin2013@xiangshuo1992@liuam007@nowherebutup@ShuiXinSuoYu

        Issue actions

          [html] 第139天 如何让textarea标签中的内容原格式输出? · Issue #1140 · haizlin/fe-interview