diff --git a/IPython/nbconvert/templates/html/basic.tpl b/IPython/nbconvert/templates/html/basic.tpl
index 86a8f68..5fb09db 100644
--- a/IPython/nbconvert/templates/html/basic.tpl
+++ b/IPython/nbconvert/templates/html/basic.tpl
@@ -53,24 +53,40 @@ In [{{ cell.prompt_number }}]:
{% endblock output %}
-{% block markdowncell scoped %}
-
-
+{% block e_in_prompt -%}
+
+
+{%- endblock e_in_prompt %}
+
+{% block m_input %}
+
{{ cell.source | markdown2html | strip_files_prefix }}
-{%- endblock markdowncell %}
+{%- endblock m_input %}
-{% block headingcell scoped %}
+{% block h_input %}
+
{{ ("#" * cell.level + cell.source) | replace('\n', ' ') | markdown2html | strip_files_prefix | add_anchor }}
-{% endblock headingcell %}
+
+{% endblock h_input %}
+
+{% block r_input %}
+
+{% if cell.metadata.get('raw_mimetype', resources.get('raw_mimetype', '')).lower() in resources.get('raw_mimetypes', ['']) %}
+ {{ cell.source }}
+{% endif %}
+
+{% endblock r_input %}
-{% block unknowncell scoped %}
+{% block u_input %}
+
unknown type {{ cell.type }}
-{% endblock unknowncell %}
+
+{% endblock u_input %}
{% block pyout -%}
diff --git a/IPython/nbconvert/templates/skeleton/null.tpl b/IPython/nbconvert/templates/skeleton/null.tpl
index 9779043..2f7b262 100644
--- a/IPython/nbconvert/templates/skeleton/null.tpl
+++ b/IPython/nbconvert/templates/skeleton/null.tpl
@@ -71,9 +71,17 @@ consider calling super even if it is a leave block, we might insert more blocks
{%- endblock codecell -%}
{%- elif cell.cell_type in ['markdown'] -%}
{%- block markdowncell scoped-%}
+ {%- block input_group -%}
+ {%- block e_in_prompt -%}{%- endblock e_in_prompt -%}
+ {%- block m_input -%}{%- endblock m_input -%}
+ {%- endblock input_group -%}
{%- endblock markdowncell -%}
{%- elif cell.cell_type in ['heading'] -%}
{%- block headingcell scoped-%}
+ {%- block input_group -%}
+ {%- block e_in_prompt -%}{%- endblock e_in_prompt -%}
+ {%- block h_input -%}{%- endblock h_input -%}
+ {%- endblock input_group -%}
{%- endblock headingcell -%}
{%- elif cell.cell_type in ['raw'] -%}
{%- block rawcell scoped -%}
@@ -83,6 +91,10 @@ consider calling super even if it is a leave block, we might insert more blocks
{%- endblock rawcell -%}
{%- else -%}
{%- block unknowncell scoped-%}
+ {%- block input_group -%}
+ {%- block e_in_prompt -%}{%- endblock e_in_prompt -%}
+ {%- block u_input -%}{%- endblock u_input -%}
+ {%- endblock input_group -%}
{%- endblock unknowncell -%}
{%- endif -%}
{%- endblock any_cell -%}