-
Notifications
You must be signed in to change notification settings - Fork 39
contain two fix and a feature #97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,6 +38,7 @@ var FuncMap = map[string]interface{}{ | |
| "makeMap": makeMap, | ||
| "makeSlice": makeSlice, | ||
| "numbers": numbers, | ||
| "steps": steps, | ||
| "pascal": kace.Pascal, | ||
| "repeat": strings.Repeat, | ||
| "replace": strings.Replace, | ||
|
|
@@ -138,6 +139,15 @@ func numbers(start, end int) data.Strings { | |
| return s | ||
| } | ||
|
|
||
| // steps returns a live of strings of the numbers start with size of len | ||
|
||
| func steps(start, len int) data.Strings { | ||
| var s data.Strings | ||
| for x := 0; x < len; x++ { | ||
| s = append(s, strconv.Itoa(start+x)) | ||
| } | ||
| return s | ||
| } | ||
|
|
||
| // Plugin returns a function which can be used in templates for executing plugins, | ||
| // dirs is the list of directories which are used fo plugin lookup. | ||
| func Plugin(dirs []string) func(string, string, interface{}) (interface{}, error) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the rationale for this change? Might a newline not be a significant part of the comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is \n in comment in pg, gnorm will throw error:
error calling makeTable: failed to render from pipe delimited bytes: record on line 4: wrong number of fields
This is about to fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just ran into this issue with some of the comments in my database. Can this be merged?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then again, this might not be the right fix. I believe I ran into this issue when running
gnorm previewon a comment containing|and). Is there an existing issue ticket for this?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pr was about to fix
\nin comment. I didn't meet the|or)issue before.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For
|and), may be needs morestrings.Replace