How to preserve whitespace indentation of text enclosed in HTML
 tags excluding the current indentation level of the 
 tag in the document?

后端 未结 11 1458
萌比男神i
萌比男神i 2020-12-02 18:32

I\'m trying to display my code on a website but I\'m having problems preserving the whitespace indentation correctly.

For instance given the following snippet:

11条回答
  •  抹茶落季
    2020-12-02 18:45

    I also found that if you're using haml you can use the preserve method. For example:

    preserve yield
    

    This will preserve the whitespace in the produced yield which is usually markdown containing the code blocks.

提交回复
热议问题