Comments (13)
Oh, I think that's because config
splits on ----\n
, and CRLF has ----\r\n
instead. Maybe we should just split by regexp there? Like, ----\r?\n
.
from gostatic.
Indeed, see source. I guess the safest version would be to use a Scanner to read line by line until the ----
has been found. See the example from the bufio package.
from gostatic.
I was also thinking - maybe try to split by \n----\n
, and if it didn't work (there is only one part), then try to split by \r\n----\r\n
.
Or even better! Choose splitter based on whenever there is \r
contained in the file or not and if somebody mixes various line endings, that's their problems. :)
from gostatic.
Well that doesn't sound too user friendly... :P I'll check if I can whip something up with a reader or whatever. That way it doesn't really matter if you use \r\n, or \n, or \r or whatever the editor/user makes of it.
from gostatic.
Hi, I got the notice and I'll test that later (not sure when, though, I'm very busy at the moment).
I've read the comments and I'm pretty sure some systems use \r as the EOL marker so shouldn't we (i.e. you ;) ) cover all combinations (CRLF, CR and LF) ? What do you think?
Aren't there native Go functions that deal with that ?
from gostatic.
There was some merit in your comment. I remember MacOS used CR exlusively, but after some research, this only seem to apply to version prior MacOS X or whatever. Check out this list, and here.
AFAIK, gostatic (or any other Go program) doesn't compile on the other systems mentioned (Acorn BBC, QNX, RISC ...), so I suppose Windows CRLF
and the Nix-es + Macs LF
remain to support.
from gostatic.
At least we've learnt something in the process. ;)
I tried both 32 and 64 bit editions of the latest version and neither worked (both on Win8 x64).
from gostatic.
Did you use a binary that was built from source? If you didn't, that explains why neither worked :) The fix has been introduced in commit 311e9e5.
from gostatic.
I went to the download page without a second look. ^^
Is there a binary with the fix lying around?
from gostatic.
I downloaded the tools and the source code but I haven't used a Makefile in a while and I'm running Windows anyway. I don't have the time to figure out how to build it at the moment, is there a "how to build GoStatic on MS Windows(R) for dummies" doc, by any chance?
from gostatic.
Let's do it other way around: I'll just check a bit later myself and will do a new release if it works. :)
from gostatic.
Ok, I've checked and it works, so you can download 2.4, which will work. :)
from gostatic.
It does indeed. Thanks. :)
from gostatic.
Related Issues (20)
- Inconsistencies with gostatic.Page HOT 2
- Globstar support
- Html formating in site.gohtml can trigger <pre><code> output HOT 1
- 2021-02-06-somepost.md style filenames date parsing
- Generate tag overview on 1 page HOT 2
- Relativize filter destroys protocolless URLs HOT 1
- Template bug? HOT 3
- Interest in Chroma highlighting? HOT 1
- ~30 golangci-lint warnings on codebase HOT 1
- 404 error handling? HOT 1
- UTF-8 with BOM support HOT 2
- Multiple outputs? HOT 3
- Question: how to you relativize paths? HOT 2
- [question] Use Date field for directory structure
- Large memory usage when downloading large files HOT 6
- [question] Config file name and file format HOT 1
- [yaml] support CRLF HOT 1
- [yaml] tags not present
- dump option HOT 1
- download script HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gostatic.