Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Kelsee Ishmael 71 posts 158 karma points
    Nov 20, 2014 @ 23:21
    Kelsee Ishmael
    0

    Markdown Editor Output Rendering

    I'm using the built in Markdown Editor available in the property editor drop down (Umbraco.MarkdownEditor). I'm using 7.1.8. Maybe I'm missing it somewhere..but I don't see any documentation on how to convert the markdown to html when redering. I'm sure I could figure out a way to render it from an outside library or creating something myself, but I would think if Umbraco included it they would have a default way of converting. Any thoughts?

    Thanks!

  • Kelsee Ishmael 71 posts 158 karma points
    Nov 21, 2014 @ 17:35
    Kelsee Ishmael
    0

    Anybody used the markdown editor at all? Even using their own rendering?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Nov 21, 2014 @ 18:27
    Jan Skovgaard
    0

    Hi Kelsee

    I'm not sure whether the build in Markdown Editor is the same as Runes simple markdown editor package http://our.umbraco.org/projects/backoffice-extensions/simple-markdown - But perhaps you could try installing and using that? In the "Documentation" tab on the package page it seems there is some documentation about how to use it.

    Hope this helps.

    /Jan

  • Kelsee Ishmael 71 posts 158 karma points
    Nov 21, 2014 @ 23:10
    Kelsee Ishmael
    0

    Thanks for the suggestion Jan!

  • Stephen 767 posts 2273 karma points c-trib
    Nov 27, 2014 @ 13:16
    Stephen
    104

    Just hit the same question... so I looked at how our expert Shannon does it in his blog package Articulate... looks like although there is a Markdown editor in Core, there is no rendering solution built-in. In Articulate, Shannon references (via NuGet) the MarkdownDeep solution and then does something along...

    var val = content.GetPropertyValue<string>("markdown");
    var md = new MarkdownDeep.Markdown();
    return new MvcHtmlString(md.Transform(val));

    To render the content.

  • Biagio Paruolo 1593 posts 1824 karma points c-trib
    Sep 18, 2016 @ 19:04
    Biagio Paruolo
    0

    here is the source: https://github.com/Shazwazza/Articulate/blob/fd43d5c69574f4067ce564d79640a83d27651b9a/src/Articulate/Models/PostModel.cs

    public IHtmlString Body
        {
            get
            {
                if (this.HasProperty("richText"))
                {
                    return this.GetPropertyValue<IHtmlString>("richText");                    
                }
                else
                {
                    var val = this.GetPropertyValue<string>("markdown");
                    var md = new MarkdownDeep.Markdown();
                    UmbracoConfig.For.ArticulateOptions().MarkdownDeepOptionsCallBack(md);
                    return new MvcHtmlString(md.Transform(val));                    
                }
    
            }
        }
    
  • Kelsee Ishmael 71 posts 158 karma points
    Nov 28, 2014 @ 20:10
    Kelsee Ishmael
    0

    Thank you, Stephen!

  • Jeremy Pyne 106 posts 246 karma points MVP c-trib
    Dec 21, 2015 @ 21:04
    Jeremy Pyne
    0

    Hrm this should be added to the property editor as a default resolver.

Please Sign in or register to post replies

Write your reply to:

Draft