zk/internal/core/note_parse_test.go
Mickaël Menu dc27a7dd7c
Improve Markdown and wiki links matching and generation (#71)
Fallback wiki link resolution by matching on title or path
Add new template variables when generating Markdown links
Add a {{substring}} template helper
2021-09-25 19:28:29 +02:00

19 lines
414 B
Go

package core
type noteContentParserMock struct {
results map[string]*NoteContent
}
func newNoteContentParserMock(results map[string]*NoteContent) *noteContentParserMock {
return &noteContentParserMock{
results: results,
}
}
func (p *noteContentParserMock) ParseNoteContent(content string) (*NoteContent, error) {
if note, ok := p.results[content]; ok {
return note, nil
}
return &NoteContent{}, nil
}