Search code examples
asp.net-mvctwitter-bootstrapprettify

Bootstrap 3.0 cause collapse entire code like a sentence, google prittyfy


I am using Markdown, google prettify and bootstrap then result comes in single line like this

Create Proc log AS Begin Try Select 10 / 0 End Try Begin Catch EXEC LogErr End Catch

Just commented out the "~/Content/bootstrap.css" file in bundling of my mvc application and result comes like this

Create Proc log 
AS 
Begin Try 
   Select 10 / 0 
End Try 
Begin Catch 
   EXEC LogErr 
End Catch

My entire application is designed by using the bootstrap, so I cannot remove this CSS, Is there any way to use the bootstrap with google prettify and markdown?


Solution

  • I found the issue, here is the class which was causing it

    pre code {
      padding: 0;
      font-size: inherit;
      color: inherit;
      white-space: pre-wrap;
      background-color: transparent;
      border-radius: 0;
    }
    

    Change to

    pre code {
      padding: 0;
      font-size: inherit;
      color: inherit;
      /*white-space: pre-wrap;*/
      background-color: transparent;
      border-radius: 0;
    }
    

    white-space: pre-wrap; was wrapping the code, might be it can help someone.