MAINT use textwrap.indent rather than str.replace
MAINT use textwrap.indent rather than str.replace

to make code cleaner

sphinx-gallery/sphinx-gallery,Titan-C/sphinx-gallery,lesteve/sphinx-gallery,Titan-C/sphinx-gallery,Eric89GXL/sphinx-gallery,Eric89GXL/sphinx-gallery,sphinx-gallery/sphinx-gallery,lesteve/sphinx-gallery