diff --git a/IPython/nbconvert/templates/html/basic.tpl b/IPython/nbconvert/templates/html/basic.tpl
index db287f3..9f7e7be 100644
--- a/IPython/nbconvert/templates/html/basic.tpl
+++ b/IPython/nbconvert/templates/html/basic.tpl
@@ -23,7 +23,7 @@
{% block in_prompt -%}
-In [{{ cell.prompt_number }}]:
+In [{{ cell.prompt_number|replace(None, " ") }}]:
{%- endblock in_prompt %}
@@ -51,7 +51,7 @@ In [{{ cell.prompt_number }}]:
{%- if output.output_type == 'pyout' -%}
- Out[{{ cell.prompt_number }}]:
+ Out[{{ cell.prompt_number|replace(None, " ") }}]:
{%- else -%}
{%- endif -%}