from __future__ import absolute_import, division, print_function

import markdown

from .clean import clean


def render(raw):
    rendered = markdown.markdown(
        raw,
        extensions=[
            'markdown.extensions.codehilite',
            'markdown.extensions.fenced_code',
            'markdown.extensions.smart_strong',
        ])
    return clean(rendered or raw), bool(rendered)

from __future__ import absolute_import, division, print_function

import markdown

from .clean import clean


def render(raw):
    rendered = markdown.markdown(
        raw,
        extensions=[
            'markdown.extensions.codehilite',
            'markdown.extensions.fenced_code',
            'markdown.extensions.smart_strong',
        ])
    if rendered:
        return clean(rendered)
    else:
        return None

Make md.render have the same API as rst.render
Make md.render have the same API as rst.render

  from __future__ import absolute_import, division, print_function
  
  import markdown
  
  from .clean import clean
  
  
  def render(raw):
      rendered = markdown.markdown(
          raw,
          extensions=[
              'markdown.extensions.codehilite',
              'markdown.extensions.fenced_code',
              'markdown.extensions.smart_strong',
          ])
-     return clean(rendered or raw), bool(rendered)
+     if rendered:
+         return clean(rendered)
+     else:
+         return None
  
Make md.render have the same API as rst.render
## Code Before:
from __future__ import absolute_import, division, print_function

import markdown

from .clean import clean


def render(raw):
    rendered = markdown.markdown(
        raw,
        extensions=[
            'markdown.extensions.codehilite',
            'markdown.extensions.fenced_code',
            'markdown.extensions.smart_strong',
        ])
    return clean(rendered or raw), bool(rendered)

## Instruction:
Make md.render have the same API as rst.render
## Code After:
from __future__ import absolute_import, division, print_function

import markdown

from .clean import clean


def render(raw):
    rendered = markdown.markdown(
        raw,
        extensions=[
            'markdown.extensions.codehilite',
            'markdown.extensions.fenced_code',
            'markdown.extensions.smart_strong',
        ])
    if rendered:
        return clean(rendered)
    else:
        return None
