@@ -35,7 +35,7 @@ type Page struct {
35
35
name string
36
36
headingIDs map [string ]int
37
37
Wiki interface {} // only available during Parse() and HTML()
38
- markdown bool // true if FilePath points to a markdown source
38
+ Markdown bool // true if this is a markdown source
39
39
model bool // true if this is a model being generated
40
40
Warnings []Warning // parser warnings
41
41
Error * Warning // parser error, as an encodable Warning
@@ -83,7 +83,7 @@ func NewPage(filePath string) *Page {
83
83
Models : make (map [string ]ModelInfo ),
84
84
PageLinks : make (map [string ][]int ),
85
85
headingIDs : make (map [string ]int ),
86
- markdown : strings .HasSuffix (filePath , ".md" ),
86
+ Markdown : strings .HasSuffix (filePath , ".md" ),
87
87
}
88
88
}
89
89
@@ -137,9 +137,12 @@ func (p *Page) _parse() error {
137
137
138
138
// create reader from file path or source code provided
139
139
var reader io.Reader
140
- if p .Source != "" {
140
+ if p .Markdown && p .Source != "" {
141
+ d := markdown .Run ([]byte (p .Source ))
142
+ reader = bytes .NewReader (d )
143
+ } else if p .Source != "" {
141
144
reader = strings .NewReader (p .Source )
142
- } else if p .markdown && p .FilePath != "" {
145
+ } else if p .Markdown && p .FilePath != "" {
143
146
md , err := ioutil .ReadFile (p .FilePath )
144
147
if err != nil {
145
148
return err
0 commit comments