Sprinkles the magic needed to support markdown. In particular, it will validate the markdown syntax
 on the column, and define a method <tt>column_html</tt> which uses BlueCloth to generate HTML.
189849
def sprinkle_markdown_magic(column)
      require 'bluecloth'
    
      extend HasMarkup::Markdown::ClassMethods
      include HasMarkup::Markdown::InstanceMethods
    
      validates_markdown_syntax column
      define_method "#{column}_html" do
        markdown = self.send(column)
        self.generate_html_from_markdown(markdown)
      end
    end
715385
def markdownify(input)
      @context.registers[:site].find_converter_instance(
        Jekyll::Converters::Markdown
      ).convert(input.to_s)
    end
542405
function htmlBeautify(content) {
    const htmlBeautifyOptions = {
        // wrap_line_length: '80',
        indent_size: 2,
        preserve_newlines: false,
        max_preserve_newlines: 0,
        e4x: true,
        unformatted: [
            'a',
            'span',
            'img',
            'code',
            'pre',
            'sub',
            'sup',
            'em',
            'strong',
            'b',
            'i',
            'u',
            'strike',
            'big',
            'small',
            'pre',
            'h1',
            'h2',
            'h3',
            'h4',
            'h5',
            'h6'
        ]
    };

    // if (isProduction) {
    //     return content;
    // }
    return jsBeautify.html(content, htmlBeautifyOptions);
}
294184
function mdToHtml(input) {
    let rule = myna.allRules['markdown.document'];
    let ast = myna.parse(rule, input);
    return mdAstToHtml(ast, []).join("");
}
227551
public static String markdownToHtml(String markdownString) {
		if (StringUtils.isBlank(markdownString)) {
			return "";
		}
		return HTML_RENDERER.render(MD_PARSER.parse(markdownString));
	}
389027
function markdown(text, inline) {
    var r;

    if (text !== undefined)
      r = md_conrefs.replaceConref(text);

    else
      r = "";

    r = namp(r).html;

    // inline markdown means to strip enclosing tag, which in this case is <p>
    if (inline === true) {
        r = r.slice(3, -5);
    }

    // FIXME
    // desugar [[foo#bar]] tokens into local links
    // N.B. in order to not apply conversion in <code> blocks,
    // we first store replace code blocks with nonces
    var codes = {};
    r = r.replace(/(<code>[\s\S]*?<\/code>)/g, function (all, def) {
      var nonce = Math.random().toString().substring(2);
      codes[nonce] = def;
      return '@-=@=-@' + nonce + '@-=@=-@';
    });

    // convert [[link]] to links
    r = r.replace(/\[\[([\s\S]+?)\]\]/g, function (all, def) {
      def = def.split(/\s+/);
      id = def.shift();
      // invalid references don't produce links
      /*if (!list[id]) {// it's in a different file--list only refers to current page
          obj = fullList[id];

          if (obj === undefined) { // it might be global
              obj = {};
              obj.id = id;
          }
      }*/
      //else {
          obj = list[id];
      //}

      var obj = _.extend({name: def.join(' ') || id, globalId: id}, list[id]);
      obj.name = def.join(' ') || id;

      // lame, but I'm tired of writing stuff like [[child_process.fork `child_process.fork()`]]
      // If I didn't do this, it'd come out as an unstyled link
      if (def.length == 0) {
        if (obj.type === undefined && additionalObjsJSON[obj.name] === undefined && obj.name !== "Mixed") {
          console.error("Error".red + ": you tried to create a short link to an object that doesn't exist!");
          console.error(obj);
        } 

        if (additionalObjsJSON[obj.name] !== undefined)
          obj.name = "<code>" + obj.name + "</code>";
        else if (obj.type && obj.type !== "class" && obj.type.indexOf("property") < 0)
          obj.name = "<code>" + obj.name + "()</code>";
        else
          obj.name = "<code>" + obj.name + "</code>";
      }

      return link(obj, ['link-short'], true);
    });

    // restore code blocks, given previously stored nonces
    r = r.replace(/@-=@=-@(\d+)@-=@=-@/g, function (all, nonce) {
      return codes[nonce];
    });

    return r;
  }
425470
def extendMarkdown(self, md, md_globals=None):
        """"""
        if any(
                x not in md.treeprocessors
                for x in self.REQUIRED_EXTENSION_INTERNAL_NAMES):
            raise RuntimeError(
                "The attr_cols markdown extension depends the following"
                " extensions which must preceded it in the extension"
                " list: %s" % ", ".join(self.REQUIRED_EXTENSIONS))
        processor = AttrColTreeProcessor(md, self.conf)
        md.treeprocessors.register(
            processor, 'attr_cols',
            5)
1350288
def markdown_to_safe_html(markdown_string):
  
  warning = ''
  # Convert to utf-8 whenever we have a binary input.
  if isinstance(markdown_string, six.binary_type):
    markdown_string_decoded = markdown_string.decode('utf-8')
    # Remove null bytes and warn if there were any, since it probably means
    # we were given a bad encoding.
    markdown_string = markdown_string_decoded.replace(u'\x00', u'')
    num_null_bytes = len(markdown_string_decoded) - len(markdown_string)
    if num_null_bytes:
      warning = ('<!-- WARNING: discarded %d null bytes in markdown string '
                 'after UTF-8 decoding -->\n') % num_null_bytes

  string_html = markdown.markdown(
      markdown_string, extensions=['markdown.extensions.tables'])
  string_sanitized = bleach.clean(
      string_html, tags=_ALLOWED_TAGS, attributes=_ALLOWED_ATTRIBUTES)
  return warning + string_sanitized
1021890
public StringBuffer markdown(Schema sinput, Schema soutput) {
    MarkdownBuilder builder = new MarkdownBuilder();
    builder.comment("Preview with http://jbt.github.io/markdown-editor");
    builder.heading1(_http_method, _url);
    builder.hline();
    builder.paragraph(_summary);
    // parameters and output tables
    builder.heading1("Input schema: ");
    builder.append(sinput .markdown(true ,false));
    builder.heading1("Output schema: ");
    builder.append(soutput.markdown(false, true));
    return builder.stringBuffer();
  }
687089
def maybe_render_markdown(string: str) -> Any:
    """"""
    if is_ipython_interpreter():  # pragma: no cover
        from IPython.display import Markdown  # type: ignore # noqa: E501

        return Markdown(string)
    else:
        return string
918650
function dummyMarkdown() {
    var codeBlock = /^```/;
    var quoteBlock = /^>/;
    var listBlock = /^\* /;

    var commentInline = '<!--.*-->';
    var codeInline = '`.+`';

    function split(content) {
        var pattern = new RegExp([commentInline, codeInline].join('|'), 'g');
        var result = null;
        var last = 0;
        var output = [];

        while ((result = pattern.exec(content)) !== null) {
            output.push({ transform: true, content: content.slice(last, result.index)});
            output.push({ transform: false, content: result[0]});
            last = pattern.lastIndex;
        }

        output.push({ transform: true, content: content.slice(last)});

        return output;
    }

    return function (input) {
        var output = [];
        var lines = input.split('\n');

        for (var l = 0; l < lines.length; l++) {
            var line = lines[l];
            var e;
            var content;

            if (codeBlock.test(line)) {
                e = l + 1;
                while (!codeBlock.test(lines[e])) {
                    e++;
                }

                output.push({ transform: false, content: lines.slice(l, e + 1).join('\n') + '\n\n' });
                l = e;
            } else if (quoteBlock.test(line)) {
                e = l + 1;
                while (quoteBlock.test(lines[e])) {
                    e++;
                }

                content = [line].concat(lines.slice(l + 1, e).map(function (nextLine) {
                    return nextLine.slice(2);
                })).join(' ') + '\n\n';

                output = output.concat(split(content));
                l = e - 1;
            } else if (listBlock.test(line)) {
                e = l + 1;
                while (lines[e] !== '') {
                    if (!listBlock.test(lines[e])) {
                        lines[e - 1] += ' ' + lines[e];
                        lines[e] = '';
                    }
                    e++;
                }

                content = lines.slice(l, e).filter(function (line) {
                    return line !== '';
                }).join('\n') + '\n';

                output = output.concat(split(content));
                l = e - 1;
            } else if (line !== '') {
                e = l + 1;
                while (lines[e] !== '') {
                    e++;
                }

                content = lines.slice(l, e).join(' ') + '\n\n';

                output = output.concat(split(content));
                l = e - 1;
            }
        }

        return output;
    };
}
873226
function Markdown(runner, options) {
  Base.call(this, runner, options);

  var level = 0;
  var buf = '';

  function title(str) {
    return Array(level).join('#') + ' ' + str;
  }

  function mapTOC(suite, obj) {
    var ret = obj;
    var key = SUITE_PREFIX + suite.title;

    obj = obj[key] = obj[key] || {suite: suite};
    suite.suites.forEach(function(suite) {
      mapTOC(suite, obj);
    });

    return ret;
  }

  function stringifyTOC(obj, level) {
    ++level;
    var buf = '';
    var link;
    for (var key in obj) {
      if (key === 'suite') {
        continue;
      }
      if (key !== SUITE_PREFIX) {
        link = ' - [' + key.substring(1) + ']';
        link += '(#' + utils.slug(obj[key].suite.fullTitle()) + ')\n';
        buf += Array(level).join('  ') + link;
      }
      buf += stringifyTOC(obj[key], level);
    }
    return buf;
  }

  function generateTOC(suite) {
    var obj = mapTOC(suite, {});
    return stringifyTOC(obj, 0);
  }

  generateTOC(runner.suite);

  runner.on(EVENT_SUITE_BEGIN, function(suite) {
    ++level;
    var slug = utils.slug(suite.fullTitle());
    buf += '<a name="' + slug + '"></a>' + '\n';
    buf += title(suite.title) + '\n';
  });

  runner.on(EVENT_SUITE_END, function() {
    --level;
  });

  runner.on(EVENT_TEST_PASS, function(test) {
    var code = utils.clean(test.body);
    buf += test.title + '.\n';
    buf += '\n```js\n';
    buf += code + '\n';
    buf += '```\n\n';
  });

  runner.once(EVENT_RUN_END, function() {
    process.stdout.write('# TOC\n');
    process.stdout.write(generateTOC(runner.suite));
    process.stdout.write(buf);
  });
}
367489
def html_format(value):
    
    if not value:
        return ''
    elif MARKUP_LANGUAGE == 'markdown':
        return markdown(value)
    elif MARKUP_LANGUAGE == 'textile':
        return textile(value)
    elif MARKUP_LANGUAGE == 'restructuredtext':
        return restructuredtext(value)
    elif '</p>' not in value:
        return linebreaks(value)
    return value
24514
def parse_markdown(markdown_content, site_settings):
    
    markdown_extensions = set_markdown_extensions(site_settings)

    html_content = markdown.markdown(
        markdown_content,
        extensions=markdown_extensions,
    )

    return html_content
765037
def to_html(self, codebase):
        
        return ('<a name = "%s" />\n<div class = "jsclass">\n' + 
                '<h3>%s</h3>\n%s\n<h4>Methods</h4>\n%s</div>') % (
                self.name, self.name, 
                htmlize_paragraphs(codebase.translate_links(self.doc, self)) +
                codebase.build_see_html(self.see, 'h4', self),
                '\n'.join(method.to_html(codebase) for method in self.methods
                        if codebase.include_private or not method.is_private))
1145004
def markdownify(input)
      site = @context.registers[:site]
      converter = site.find_converter_instance(Bunto::Converters::Markdown)
      converter.convert(input.to_s)
    end
1227274
function createMarkdownSlide( content, options ) {

		options = getSlidifyOptions( options );

		var notesMatch = content.split( new RegExp( options.notesSeparator, 'mgi' ) );

		if( notesMatch.length === 2 ) {
			content = notesMatch[0] + '<aside class="notes" data-markdown>' + notesMatch[1].trim() + '</aside>';
		}

		return '<script type="text/template">' + content + '</script>';

	}