diff --git a/Teknik/Areas/Blog/Scripts/Blog.js b/Teknik/Areas/Blog/Scripts/Blog.js index 7c852f2..8a21906 100644 --- a/Teknik/Areas/Blog/Scripts/Blog.js +++ b/Teknik/Areas/Blog/Scripts/Blog.js @@ -2,7 +2,10 @@ $("textarea.mdd_editor").MarkdownDeep({ help_location: helpURL, disableTabHandling: false, - resizebar: false + resizebar: false, + SafeMode: true, + ExtraMode: true, + MarkdownInHtml: true }); $("#comment_submit").click(function () { diff --git a/Teknik/Areas/Help/Views/Help/Markdown.cshtml b/Teknik/Areas/Help/Views/Help/Markdown.cshtml index e204a16..ce647f4 100644 --- a/Teknik/Areas/Help/Views/Help/Markdown.cshtml +++ b/Teknik/Areas/Help/Views/Help/Markdown.cshtml @@ -10,130 +10,179 @@

Markdown Formatting

Markdown turns plain text formatting into fancy HTML formatting.

+

Phrase Emphasis

*italic*   **bold**
-        _italic_   __bold__
-        
+_italic_ __bold__ +

Links

+

Inline:

-
An [example](http://url.com/ "Title")
-        
+
An [example](http://url.com/ "Title")
+

Reference-style labels (titles are optional):

-
An [example][id]. Then, anywhere
-        else in the doc, define the link:
-          [id]: http://example.com/  "Title"
-        
+
An [example][id]. 
+
+Then, anywhere else in the doc, define the link: 
+[id]: http://example.com/  "Title"
+

Images

+

Inline (titles are optional):

-
![alt text](/path/img.jpg "Title")
-        
+
![alt text](/path/img.jpg "Title")
+

Reference-style:

![alt text][id]
-        [id]: /url/to/img.jpg "Title"
-        
+[id]: /url/to/img.jpg "Title" +

Headers

+

Setext-style:

Header 1
-        ========
-        Header 2
-        --------
-        
+======== +Header 2 +-------- +

atx-style (closing #'s are optional):

# Header 1 #
-        ## Header 2 ##
-        ###### Header 6
-        
+## Header 2 ## +###### Header 6 +

Lists

+

Ordered, without paragraphs:

1.  Foo
-        2.  Bar
-        
+2. Bar +

Unordered, with paragraphs:

*   A list item.
-            With multiple paragraphs.
-        *   Bar
-        
+ With multiple paragraphs. +* Bar +

You can nest them:

*   Abacus
-            * answer
-        *   Bubbles
-            1.  bunk
-            2.  bupkis
-                * BELITTLER
-            3. burper
-        *   Cunning
-        
+ * answer +* Bubbles + 1. bunk + 2. bupkis + * BELITTLER + 3. burper +* Cunning +

Blockquotes

+
> Email-style angle brackets
-        > are used for blockquotes.
-        > > And, they can be nested.
-        > #### Headers in blockquotes
-        > 
-        > * You can quote a list.
-        > * Etc.
-        
+> are used for blockquotes. +> > And, they can be nested. +> #### Headers in blockquotes +> +> * You can quote a list. +> * Etc. +

Code Spans

-
`<code>` spans are delimited
-        by backticks.
-        You can include literal backticks
-        like `` `this` ``.
-        
+ +
`<code>` spans are delimited by backticks.
+
+You can include literal backticks like `` `this` ``.
+

Preformatted Code Blocks

+

Indent every line of a code block by at least 4 spaces or 1 tab.

This is a normal paragraph.
-            This is a preformatted
-            code block.
-        
+ + This is a preformatted + code block. +

Horizontal Rules

+

Three or more dashes or asterisks:

---
-        * * *
-        - - - - 
-        
+* * * +- - - - +

Manual Line Breaks

+

End a line with two or more spaces:

Roses are red,   
-        Violets are blue.
-        
-

Extra Mode

- These formatting features are only available when Extra Mode is enabled. +Violets are blue.

Markdown In Html

+

Enable markdown in HTML block level elements:

<div markdown="1">
-        Markdown **still** works.
-        </div>
-        
+Markdown **still** works. +</div> +

Fenced Code Blocks

+

Code blocks delimited by 3 or more tildas:

~~~
-        This is a preformatted
-        code block
-        ~~~
-        
+This is a preformatted +code block +~~~ +

Header IDs

+

Set the id of headings with {#<id>} at end of heading line:

-
## My Heading {#myheading}
-        
+
## My Heading {#myheading}
+

Tables

+
Fruit    |Color
-        ---------|----------
-        Apples   |Red
-        Pears	 |Green
-        Bananas  |Yellow
+---------|---------- +Apples |Red +Pears |Green +Bananas |Yellow +

Definition Lists

+
Term 1
-        : Definition 1
-        Term 2
-        : Definition 2
+: Definition 1 +Term 2 +: Definition 2 +

Footnotes

+
Body text with a footnote [^1]
-        [^1]: Footnote text here
-        
+[^1]: Footnote text here +

Abbreviations

+
MDD <- will have title
-        *[MDD]: MarkdownDeep
-        
-

 

+*[MDD]: MarkdownDeep + +

Allowed HTML Tags

+ + +
diff --git a/Teknik/Areas/Vault/Scripts/Vault.js b/Teknik/Areas/Vault/Scripts/Vault.js index 44b1ab1..3079c66 100644 --- a/Teknik/Areas/Vault/Scripts/Vault.js +++ b/Teknik/Areas/Vault/Scripts/Vault.js @@ -2,7 +2,10 @@ $("textarea.mdd_editor").MarkdownDeep({ help_location: helpURL, disableTabHandling: false, - resizebar: false + resizebar: false, + SafeMode: true, + ExtraMode: true, + MarkdownInHtml: true }); $('.hideContent').each(function () { diff --git a/Utilities/Utilities/MarkdownHelper.cs b/Utilities/Utilities/MarkdownHelper.cs index e3f5cba..66446a1 100644 --- a/Utilities/Utilities/MarkdownHelper.cs +++ b/Utilities/Utilities/MarkdownHelper.cs @@ -20,6 +20,7 @@ namespace Teknik.Utilities var markdownTransformer = new Markdown(); markdownTransformer.ExtraMode = true; markdownTransformer.SafeMode = true; + markdownTransformer.MarkdownInHtml = true; string html = markdownTransformer.Transform(text); // Wrap the html in an MvcHtmlString otherwise it'll be HtmlEncoded and displayed to the user as HTML :(