in src/org/jetbrains/plugins/ipnb/format/IpnbParser.java [424:465]
public IpnbOutputCell createOutput() {
List<String> text = this.text != null ? this.text : data != null ? data.text : Lists.newArrayList();
Integer prompt = execution_count != null ? execution_count : prompt_number;
final IpnbOutputCell outputCell;
if (png != null || (data != null && data.png != null)) {
outputCell = new IpnbPngOutputCell(png == null ? data.png : png, text, prompt, metadata);
}
else if (jpeg != null || (data != null && data.jpeg != null)) {
outputCell = new IpnbJpegOutputCell(jpeg == null ? StringUtil.join(data.jpeg, "") : jpeg, text, prompt, metadata);
}
else if (svg != null || (data != null && data.svg != null)) {
outputCell = new IpnbSvgOutputCell(svg == null ? data.svg : svg, text, prompt, metadata);
}
else if (html != null || (data != null && data.html != null)) {
outputCell = new IpnbHtmlOutputCell(html == null ? data.html : html, text, prompt, metadata);
}
else if (latex != null || (data != null && data.latex != null)) {
outputCell = new IpnbLatexOutputCell(latex == null ? data.latex : latex, false, prompt, text, metadata);
}
else if (data != null && data.markdown != null) {
outputCell = new IpnbLatexOutputCell(data.markdown, true, prompt, text, metadata);
}
else if (stream != null || name != null) {
outputCell = new IpnbStreamOutputCell(stream == null ? name : stream, text, prompt, metadata);
}
else if ("pyerr".equals(output_type) || "error".equals(output_type)) {
outputCell = new IpnbErrorOutputCell(evalue, ename, traceback, prompt, metadata);
}
else if ("pyout".equals(output_type)) {
outputCell = new IpnbOutOutputCell(text, prompt, metadata);
}
else if ("execute_result".equals(output_type) && data != null) {
outputCell = new IpnbOutOutputCell(data.text, prompt, metadata);
}
else if ("display_data".equals(output_type)) {
outputCell = new IpnbPngOutputCell(null, text, prompt, metadata);
}
else {
outputCell = new IpnbOutputCell(text, prompt, metadata);
}
return outputCell;
}