-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfileformat.go
39 lines (33 loc) · 867 Bytes
/
fileformat.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package ftml
const LineBreakElementName = "br"
const LineBreakElement = "<" + LineBreakElementName + " />"
var wrapperElements = map[string]ParagraphType{
// Contains text
"p": TextParagraph,
"h1": Header1Paragraph,
"h2": Header2Paragraph,
"h3": Header3Paragraph,
// Contains child paragraphs
"blockquote": QuoteParagraph,
// Contains items each of which contain child paragraphs
"ul": UnorderedListParagraph,
"ol": OrderedListParagraph,
}
var inlineElements = map[string]InlineStyle{
"b": StyleBold,
"i": StyleItalic,
"u": StyleUnderline,
"s": StyleStrike,
"mark": StyleHighlight,
"code": StyleCode,
}
var elementTags = map[ParagraphType]string{}
var styleTags = map[InlineStyle]string{}
func init() {
for tag, t := range wrapperElements {
elementTags[t] = tag
}
for tag, s := range inlineElements {
styleTags[s] = tag
}
}