Question

I created a web page in ASP.NET 4.0.
I'm using MarkdownDeep library (http://www.toptensoftware.com/markdowndeep/) to convert some text to HTML.
I found an issue that I can't fix. I hope you can help me.

I have some kind of forum, a want to post some code into the comment and see the indentation. In the markdown preview editor, the text looks good. I save the textarea content to a database I show in the page, and I looks good.
For example, I try show two element tags of html to see the indentation on the code. If I see the code with Chrome Development Tools, I look this:

<pre><code>&lt;head&gt;
    &lt;title&gt;
</code></pre>

It shows like this: enter image description here

Everything is fine. But, if I reload the page, it appears like this

<pre><code>&lt;head&gt;&lt;title&gt;
</code></pre>

And it shows like this: enter image description here

What I'm doing is:

  1. write some text in the textarea
  2. save text to the database
  3. bring text back from database
  4. converting markdown to html with the Transform() method of MarkdownDeep
  5. put the result to the a Label's Text property

I tried, converting markdown before saving to the database, but nothing changes.

Was it helpful?

Solution

Ok, I finally found the solution.
That code was in a page that have a masterpage. If I took away the masterpage, everything is fine. I don't know why... but that issue dissapear.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top