all repos — grayfriday @ 67f85cf5402d868ce31bba86853cf34c4f820269

blackfriday fork with a few changes

Move code block fields to a nested struct
Vytautas Ĺ altenis vytas@rtfb.lt
Fri, 01 Apr 2016 11:29:15 +0300
commit

67f85cf5402d868ce31bba86853cf34c4f820269

parent

c8eb73377e47b45fc49910ae45aabb7948c4d32c

1 files changed, 14 insertions(+), 11 deletions(-)

jump to
M node.gonode.go

@@ -79,6 +79,14 @@ Title []byte

NoteID int } +type CodeBlockData struct { + IsFenced bool // Specifies whether it's a fenced code block or an indented one + Info []byte // This holds the info string + FenceChar byte + FenceLength uint32 + FenceOffset uint32 +} + type Node struct { Type NodeType Parent *Node

@@ -93,17 +101,12 @@

Level uint32 // If Type == Header, this holds the heading level number Literal []byte - ListData // If Type == List, this holds list info - // TODO: move these fenced code block fields to a substruct - IsFenced bool // If Type == CodeBlock, specifies whether it's a fenced code block or an indented one - Info []byte // If Type == CodeBlock, this holds the info string - FenceChar byte - FenceLength uint32 - FenceOffset uint32 - LinkData // If Type == Link, this holds link info - HeaderID string // If Type == Header, this might hold header ID, if present - IsTitleblock bool - IsHeader bool // If Type == TableCell, this tells if it's under the header row + ListData // If Type == List, this holds list info + CodeBlockData // If Type == CodeBlock, this holds its properties + LinkData // If Type == Link, this holds link info + HeaderID string // If Type == Header, this might hold header ID, if present + IsTitleblock bool + IsHeader bool // If Type == TableCell, this tells if it's under the header row // TODO: convert the int to a proper type Align int // If Type == TableCell, this holds the value for align attribute