I'm thinking about adding a blog to my site, so I'm using Prettyprint to style the code, problem is the styling is not displaying correctly as can be seen by the image.
line 1 is blank and the last 2 lines are blank and 2nd line is to far to the right.
I tried to write some code in jQuery but it to aggressive and removed all the indents.
$(document).ready(function () { $(".prettyprint").each(function (index, element) { element.textContent = element.textContent.replace(/^\s+/mg, ""); }); }); As image below shows
So does anyone know how to remove the empty lines and pull 2nd line to left
Controller Code and partial
[ChildActionOnly] public ActionResult DisplayCode(IEnumerable<IPublishedContent> comps) { var components = comps; CodeBlock subModel = null; foreach (var item in components) { string codeBlockText = item.GetPropertyValue<string>("codeBlock", "No Code Found"); subModel = new CodeBlock { TextString = codeBlockText }; } var primaryModel = new NestedContentViewModel { DisplayCodeBlock = subModel }; return PartialView("~/Views/Partials/pvCodeBlock.cshtml", primaryModel); } <div class="container"> <div class="row"> <div class="col-md-12"> <pre class="prettyprint linenums:1"> <code> @Model.DisplayCodeBlock.TextString.Trim() </code> </pre> </div> </div> </div> 

<pre>tag and the markup generated by prettyprint.like this`` (especially HTML).