Fix type of id to match the new editor structure
This commit is contained in:
parent
9e24fd03bd
commit
2c50de9a29
|
@ -28,7 +28,7 @@ func processBackrefs(fp *FilePages) error {
|
||||||
content := page.Content
|
content := page.Content
|
||||||
|
|
||||||
var listItems []struct {
|
var listItems []struct {
|
||||||
Id int
|
ID string
|
||||||
Indented int
|
Indented int
|
||||||
Text string
|
Text string
|
||||||
}
|
}
|
||||||
|
|
4
main.go
4
main.go
|
@ -462,7 +462,7 @@ func (h *indexHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
jsonPage := pageText != "" && err == nil
|
jsonPage := pageText != "" && err == nil
|
||||||
if jsonPage {
|
if jsonPage {
|
||||||
var listItems []struct {
|
var listItems []struct {
|
||||||
Id int
|
ID string
|
||||||
Indented int
|
Indented int
|
||||||
Text string
|
Text string
|
||||||
}
|
}
|
||||||
|
@ -636,7 +636,7 @@ func main() {
|
||||||
content := page.Content
|
content := page.Content
|
||||||
|
|
||||||
var listItems []struct {
|
var listItems []struct {
|
||||||
Id int
|
ID string
|
||||||
Indented int
|
Indented int
|
||||||
Text string
|
Text string
|
||||||
}
|
}
|
||||||
|
|
19
util_test.go
19
util_test.go
|
@ -27,3 +27,22 @@ func TestParseLinks(t *testing.T) {
|
||||||
assert.Equal(t, links[2].PageName, "Project_notes")
|
assert.Equal(t, links[2].PageName, "Project_notes")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestTagLinks(t *testing.T) {
|
||||||
|
example := `
|
||||||
|
* #[[TODO]] Test1
|
||||||
|
* #[[TODO]] Test2
|
||||||
|
* #[[TODO]] Test3
|
||||||
|
* #[[TODO]] Test4
|
||||||
|
`
|
||||||
|
|
||||||
|
links, err := ParseLinks(example)
|
||||||
|
|
||||||
|
if assert.NoError(t, err, "should parse example") {
|
||||||
|
assert.Len(t, links, 4, "should contain 3 links")
|
||||||
|
|
||||||
|
assert.Equal(t, links[0].Line, "* #[[TODO]] Test1")
|
||||||
|
assert.Equal(t, links[0].Name, "TODO")
|
||||||
|
assert.Equal(t, links[0].PageName, "TODO")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user