Skip to content

Commit

Permalink
Fix: InlineMath (and others) problems for Document types / JSON par…
Browse files Browse the repository at this point in the history
…sing
  • Loading branch information
iagobaapellaniz authored Oct 6, 2023
1 parent 8757882 commit 7c3ec6b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ function ColSpec(d::Vector)
ColSpec(alignment, ColWidth(colwidth))
end
StructTypes.StructType(::Type{ColSpec}) = StructTypes.CustomStruct()
StructTypes.lower(e::ColSpec) = [e.alignment, e.colwidth]
StructTypes.lower(e::ColSpec) = [Dict("t" => e.alignment), e.colwidth]

"""
The number of rows occupied by a cell; the height of a cell.
Expand Down Expand Up @@ -381,7 +381,7 @@ function Cell(v::Vector)
Cell(Attr(attr...), alignment, rowspan, colspan, map(Block, content))
end
StructTypes.StructType(::Type{Cell}) = StructTypes.CustomStruct()
StructTypes.lower(e::Cell) = [e.attr, e.alignment, e.rowspan, e.colspan, e.content]
StructTypes.lower(e::Cell) = [e.attr, Dict("t" => e.alignment), e.rowspan, e.colspan, e.content]

"""
Row
Expand Down Expand Up @@ -712,7 +712,7 @@ Base.@kwdef mutable struct Math <: Inline
math_type::MathType.T
content::Text = ""
end
StructTypes.lower(e::Math) = OrderedDict(["t" => "Math", "c" => [e.math_type, e.content]])
StructTypes.lower(e::Math) = OrderedDict(["t" => "Math", "c" => [Dict("t" => e.math_type), e.content]])
function StructTypes.constructfrom(::Type{Math}, d::Dict)
math_type, content = d["c"]
math_type = if math_type["t"] == "DisplayMath"
Expand Down

0 comments on commit 7c3ec6b

Please sign in to comment.