I have made my own custom little blog and well, I realized it was ignoring whitespace within code tags. Well, the generated code is like
<div class="codebody">
Mycode<br/>
  other indented code<br/>
othercode<br/>
</div>
my codeb开发者_JS百科ody class looks like
.codebody {
   background-color: #FFFFFF;
    font-family: Courier new, courier, mono;
    font-size: 12px;
    color: #006600;
    border: 1px solid #BFBFBF;
}
Well, how can I make it so that indentation will show up in code tags, but it won't  add double-line breaks because of the <br/>\n?
Well just figured out something.. I'm not sure that it works in all browsers, as it is a pretty nasty hack, but this is what I did
.codebody {
    white-space: pre;
    background-color: #FFFFFF;
    font-family: Courier new, courier, mono;
    font-size: 12px;
    color: #006600;
    border: 1px solid #BFBFBF;
}
.codebody br{
    display: none;
}
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论