How to capture the markdown from a WMD-Editor server side in a ASP.NET website?

StackOverflow https://stackoverflow.com/questions/2081012

  •  21-09-2019
  •  | 
  •  

문제

I'm using an asp:TextBox as the wmd-input. As the user clicks the submit button I wan't to capture the markdown at server side as the Text property of my asp:TextBox control.

However, instead of the expected markdown, my TextBox at server-side contains the HTML formatted version of the markdown:

<h1>testing</h1>

How do I get the pure markdown?

PS: At client side I see markdown on the asp:TextBox. It's not clear for me when it's getting converted to HTML before post-back.

도움이 되었습니까?

해결책

Figured it out myself.

WMD-Editor supports a configuration that determines the output of the editor. Check out the file optionsExample.html that comes with the downloadable version.

In my case I just needed to add this before the showdown.js reference:

<script type="text/javascript">
        window['wmd_options'] = {
            output: "Markdown",
            buttons: "bold italic | link blockquote image | ol ul heading hr"
        };
    </script>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top