Skip to content

Commit

Permalink
Teach Markdown how to output inline LaTeX to RST
Browse files Browse the repository at this point in the history
  • Loading branch information
mbauman committed Sep 11, 2015
1 parent 8f08a1f commit 7fac5cb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion base/markdown/render/rst.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function rstinline(io::IO, md...)
wasCode = false
for el in md
wasCode && isa(el, AbstractString) && !Base.startswith(el, " ") && print(io, "\\ ")
wasCode = isa(el, Code) && (wasCode = true)
wasCode = (isa(el, Code) || isa(el, LaTeX)) && (wasCode = true)
rstinline(io, el)
end
end
Expand All @@ -96,6 +96,8 @@ rstinline(io::IO, md::Code) = print(io, "``", md.code, "``")

rstinline(io::IO, br::LineBreak) = println(io)

rstinline(io::IO, l::LaTeX) = print(io, ":math:`", l.formula, "`")

rstinline(io::IO, x) = writemime(io, MIME"text/rst"(), x)

# writemime
Expand Down

0 comments on commit 7fac5cb

Please sign in to comment.