Fixes #36
This commit is contained in:
parent
a717164334
commit
e2ad05cf0d
2
post.go
2
post.go
|
@ -181,6 +181,8 @@ func (post *Post) RenderedContent() string {
|
||||||
// trim yaml block
|
// trim yaml block
|
||||||
// TODO this can be done nicer
|
// TODO this can be done nicer
|
||||||
trimmedData := bytes.TrimSpace(data)
|
trimmedData := bytes.TrimSpace(data)
|
||||||
|
// ensure that data ends with a newline
|
||||||
|
trimmedData = append(trimmedData, []byte("\n")...)
|
||||||
// check first line is ---
|
// check first line is ---
|
||||||
if string(trimmedData[0:4]) == "---\n" {
|
if string(trimmedData[0:4]) == "---\n" {
|
||||||
trimmedData = trimmedData[4:]
|
trimmedData = trimmedData[4:]
|
||||||
|
|
|
@ -465,6 +465,15 @@ func TestComplexParallelWebmentions(t *testing.T) {
|
||||||
assertions.AssertLen(t, outs, 20)
|
assertions.AssertLen(t, outs, 20)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestPostWithoutContent(t *testing.T) {
|
||||||
|
repo := getTestRepo(owl.RepoConfig{})
|
||||||
|
user, _ := repo.CreateUser("testuser")
|
||||||
|
post, _ := user.CreateNewPostFull(owl.PostMeta{}, "")
|
||||||
|
|
||||||
|
result := post.RenderedContent()
|
||||||
|
assertions.AssertEqual(t, result, "")
|
||||||
|
}
|
||||||
|
|
||||||
// func TestComplexParallelSimulatedProcessesWebmentions(t *testing.T) {
|
// func TestComplexParallelSimulatedProcessesWebmentions(t *testing.T) {
|
||||||
// repoName := testRepoName()
|
// repoName := testRepoName()
|
||||||
// repo, _ := owl.CreateRepository(repoName, owl.RepoConfig{})
|
// repo, _ := owl.CreateRepository(repoName, owl.RepoConfig{})
|
||||||
|
|
Loading…
Reference in New Issue