Skip to content

Commit

Permalink
Change file format: add an empty line after meta block
Browse files Browse the repository at this point in the history
  • Loading branch information
minodisk committed Feb 17, 2016
1 parent 4b8dbf5 commit ad111f5
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 1 deletion.
1 change: 1 addition & 0 deletions cli/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ tags:
- 0.0.1
team: null
-->
# Example title
## Example body`
if actual != expected {
Expand Down
15 changes: 15 additions & 0 deletions command/post_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ tags:
- 0.0.1
team: null
-->
# Example Title
## Example body`
if actual != expected {
Expand Down Expand Up @@ -168,6 +169,7 @@ tags:
- 0.0.1
team: null
-->
# Example old title
## Example old body`), 0644)
if err != nil {
Expand Down Expand Up @@ -206,6 +208,7 @@ tags:
- 0.0.1
team: null
-->
# Example Title
## Example body`
if actual != expected {
Expand Down Expand Up @@ -379,6 +382,7 @@ tags:
- 0.0.1
team: null
-->
# Example old title
## Example old body`), 0644)
if err != nil {
Expand Down Expand Up @@ -692,6 +696,7 @@ tags:
- 0.0.1
team: null
-->
# Example Title
## Example body`
if actual != expected {
Expand Down Expand Up @@ -720,6 +725,7 @@ team:
id: increments
name: Increments Inc.
-->
# Example Title in team
## Example body in team`
if actual != expected {
Expand Down Expand Up @@ -892,6 +898,7 @@ tags:
- "1.0"
team: null
-->
# Example Edited Title
## Example Edited Body`), 0664)
if err != nil {
Expand Down Expand Up @@ -933,6 +940,7 @@ tags:
- "1.0"
team: null
-->
# Example Edited Title
## Example Edited Body`
if actual != expected {
Expand Down Expand Up @@ -1018,6 +1026,7 @@ tags:
- "1.0"
team: null
-->
# Example Edited Title
## Example Edited Body`), 0664)
if err != nil {
Expand Down Expand Up @@ -1082,6 +1091,7 @@ tags:
- "1.0"
team: null
-->
# Example Edited Title
## Example Edited Body`), 0664)
if err != nil {
Expand Down Expand Up @@ -1123,6 +1133,7 @@ tags:
- "1.0"
team: null
-->
# Example Edited Title
## Example Edited Body`
if actual != expected {
Expand Down Expand Up @@ -1213,6 +1224,7 @@ tags:
- "1.0"
team: null
-->
# Example Edited Title
## Example Edited Body`), 0664)
if err != nil {
Expand Down Expand Up @@ -1277,6 +1289,7 @@ tags:
- "1.0"
team: null
-->
# Example Edited Title
## Example Edited Body`), 0664)
if err != nil {
Expand Down Expand Up @@ -1318,6 +1331,7 @@ tags:
- "1.0"
team: null
-->
# Example Edited Title
## Example Edited Body`
if actual != expected {
Expand Down Expand Up @@ -1408,6 +1422,7 @@ tags:
- "1.0"
team: null
-->
# Example Edited Title
## Example Edited Body`), 0664)
if err != nil {
Expand Down
3 changes: 2 additions & 1 deletion model/post.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const (
postTemplate = `<!--
{{.Meta.Encode}}
-->
# {{.Title}}
{{.Body}}`

Expand All @@ -30,7 +31,7 @@ const (
)

var (
rPostDecoder = regexp.MustCompile(`^(?ms:\n*<!--(.*)-->\n*# +(.*?)\n+(.*))$`)
rPostDecoder = regexp.MustCompile(`^(?ms:\n*<!--(.*)-->\n{2,}# +(.*?)\n+(.*))$`)
tmpl = func() (t *template.Template) {
t = template.New("postfile")
template.Must(t.Parse(postTemplate))
Expand Down
14 changes: 14 additions & 0 deletions model/post_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ tags:
- 1.5.3
team: null
-->
# Main title
## Sub title
Paragraph
Expand Down Expand Up @@ -146,6 +147,7 @@ tags:
- 1.5.3
team: null
-->
## Sub title
Paragraph
`), 0644)
Expand Down Expand Up @@ -1347,6 +1349,7 @@ coediting: false
tags: []
team: null
-->
# Example Title
`
if actual != expected {
Expand Down Expand Up @@ -1387,6 +1390,7 @@ coediting: false
tags: []
team: null
-->
# Example Edited Title
`
if actual != expected {
Expand Down Expand Up @@ -1429,6 +1433,7 @@ team:
id: increments
name: Increments Inc.
-->
# Example Title
`
if actual != expected {
Expand Down Expand Up @@ -1472,6 +1477,7 @@ team:
id: increments
name: Increments Inc.
-->
# Example Edited Title
`
if actual != expected {
Expand Down Expand Up @@ -1512,6 +1518,7 @@ coediting: false
tags: []
team: null
-->
# Example Title
`
if actual != expected {
Expand Down Expand Up @@ -1542,6 +1549,7 @@ coediting: false
tags: []
team: null
-->
# Example Title
`), 0644)
if err != nil {
Expand Down Expand Up @@ -1581,6 +1589,7 @@ coediting: false
tags: []
team: null
-->
# Example Title
`
if actual != expected {
Expand Down Expand Up @@ -1661,6 +1670,7 @@ coediting: false
tags: []
team: null
-->
# Example title
`
if expected != actual {
Expand Down Expand Up @@ -1690,6 +1700,7 @@ tags:
- 1.5.3
team: null
-->
# Main title
## Sub title
Paragraph
Expand Down Expand Up @@ -1720,6 +1731,7 @@ tags:
- 1.5.3
team: null
-->
# Main title
## Sub title
Paragraph
Expand Down Expand Up @@ -1750,6 +1762,7 @@ tags:
- 1.5.3
team: null
-->
## Sub title
# Main title
Paragraph
Expand Down Expand Up @@ -1780,6 +1793,7 @@ tags:
- 1.5.3
team: null
-->
# Main title
## Sub title
Paragraph
Expand Down
2 changes: 2 additions & 0 deletions model/posts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ coediting: false
tags: []
team: null
-->
# Example Title 0
`
if actual != expected {
Expand All @@ -450,6 +451,7 @@ coediting: false
tags: []
team: null
-->
# Example Title 1
`
if actual != expected {
Expand Down

0 comments on commit ad111f5

Please sign in to comment.