How can I ignore leading and trailing linebreaks within an html “code” block using css, javascript or jquery?

前端 未结 6 883
伪装坚强ぢ
伪装坚强ぢ 2021-02-19 18:59

In my HTML source code, I have a code block like the following (I use showdown and highlight.js on this page):


double myNum         


        
6条回答
  •  忘了有多久
    2021-02-19 19:51

    Here's another approach using Javascript that also solves the problem:

    
    

    Someone else posted this, then deleted their answer, but I thought it was worth preserving.

提交回复
热议问题