Maybe here: https://github.com/ipython/ipython/blob/89e5914079ec34785a61f7a36be6dd54ac7cedc6/IPython/nbconvert/exporters/exporter.py#L146