diff --git a/src/display_methods.jl b/src/display_methods.jl
index 9161479..8c32730 100644
--- a/src/display_methods.jl
+++ b/src/display_methods.jl
@@ -33,15 +33,17 @@ function Base.display(report::Report, data)
for m in report.mimetypes
if mimewritable(m, data)
try
- Compat.invokelatest(display, report, m, data)
+ if !istextmime(m)
+ Compat.invokelatest(display, report, m, data)
+ elseif report.cur_chunk.options[:term]
+ display(report, "text/plain", data)
+ else
+ Compat.invokelatest(display, report, m, data)
+ end
catch e
warn("Failed to display data in \"$m\" format")
continue
end
- #Always show plain text as well for term mode
- #if m ≠ "text/plain" && report.cur_chunk.options[:term]
- # display(report, "text/plain", data)
- #end
break
end
end
diff --git a/test/documents/multimedia/rich_output.github.ref b/test/documents/multimedia/rich_output.github.ref
index 20d9c81..ce3f9b5 100644
--- a/test/documents/multimedia/rich_output.github.ref
+++ b/test/documents/multimedia/rich_output.github.ref
@@ -52,6 +52,24 @@ display(x)
+````julia
+julia> x
+3×2 Array{Int64,2}:
+ 1 1
+ 2 2
+ 3 3
+
+julia> ca
+4-element Array{Char,1}:
+ 'a'
+ 'b'
+ 'c'
+ 'd'
+
+````
+
+
+
````julia
m = Base.Markdown.parse("**Some Markdown**")
m
diff --git a/test/documents/multimedia/rich_output.html.ref b/test/documents/multimedia/rich_output.html.ref
index 19ce5b5..434e933 100644
--- a/test/documents/multimedia/rich_output.html.ref
+++ b/test/documents/multimedia/rich_output.html.ref
@@ -55,6 +55,21 @@
+
+julia> x
+3×2 Array{Int64,2}:
+ 1 1
+ 2 2
+ 3 3
+
+julia> ca
+4-element Array{Char,1}:
+ 'a'
+ 'b'
+ 'c'
+ 'd'
+
+
m = Base.Markdown.parse("**Some Markdown**")
diff --git a/test/documents/multimedia/rich_output.md.ref b/test/documents/multimedia/rich_output.md.ref
index b3f2e88..6c7904a 100644
--- a/test/documents/multimedia/rich_output.md.ref
+++ b/test/documents/multimedia/rich_output.md.ref
@@ -66,6 +66,24 @@ display(x)
| 3 | 3 |
-----
+~~~~{.julia}
+julia> x
+3×2 Array{Int64,2}:
+ 1 1
+ 2 2
+ 3 3
+
+julia> ca
+4-element Array{Char,1}:
+ 'a'
+ 'b'
+ 'c'
+ 'd'
+
+~~~~~~~~~~~~~
+
+
+
~~~~{.julia}
m = Base.Markdown.parse("**Some Markdown**")
m
diff --git a/test/documents/multimedia/rich_output.tex.ref b/test/documents/multimedia/rich_output.tex.ref
index 45c3c16..209cda7 100644
--- a/test/documents/multimedia/rich_output.tex.ref
+++ b/test/documents/multimedia/rich_output.tex.ref
@@ -62,6 +62,22 @@ d & \\ \hline
3 & 3 & \\ \hline
\end{tabular
+\begin{juliaterm}
+julia> x
+3×2 Array{Int64,2}:
+ 1 1
+ 2 2
+ 3 3
+
+julia> ca
+4-element Array{Char,1}:
+ 'a'
+ 'b'
+ 'c'
+ 'd'
+
+\end{juliaterm}
+
\begin{juliacode}
m = Base.Markdown.parse("**Some Markdown**")
m
diff --git a/test/documents/rich_output.jmd b/test/documents/rich_output.jmd
index a4087ba..7bf8b11 100644
--- a/test/documents/rich_output.jmd
+++ b/test/documents/rich_output.jmd
@@ -45,6 +45,12 @@ display(ca)
display(x)
```
+```julia; term=true
+x
+ca
+```
+
+
```julia
m = Base.Markdown.parse("**Some Markdown**")
m