Run of fresh-snapshots for golang-github-gorilla-css

Merge these changes:

Summary

Merged new upstream version: 1.0.0+git20190626.1.4940b8d (was: 1.0.0).

Diff

diff --git a/.circleci/config.yml b/.circleci/config.yml
new file mode 100644
index 0000000..c6f28aa
--- /dev/null
+++ b/.circleci/config.yml
@@ -0,0 +1,65 @@
+version: 2.0
+
+jobs:
+  # Base test configuration for Go library tests Each distinct version should
+  # inherit this base, and override (at least) the container image used.
+  "test": &test
+    docker:
+      - image: circleci/golang:latest
+    working_directory: /go/src/github.com/gorilla/css
+    steps: &steps
+      - checkout
+      - run: go version
+      - run: go get -t -v ./...
+      - run: diff -u <(echo -n) <(gofmt -d .)
+      - run: if [[ "$LATEST" = true ]]; then go vet -v .; fi
+      - run: go test -v -race ./...
+
+  "latest":
+    <<: *test
+    environment:
+      LATEST: true
+
+
+  "1.12":
+    <<: *test
+    docker:
+      - image: circleci/golang:1.12
+
+  "1.11":
+    <<: *test
+    docker:
+      - image: circleci/golang:1.11
+
+  "1.10":
+    <<: *test
+    docker:
+      - image: circleci/golang:1.10
+
+  "1.9":
+    <<: *test
+    docker:
+      - image: circleci/golang:1.9
+
+  "1.8":
+    <<: *test
+    docker:
+      - image: circleci/golang:1.8
+
+  "1.7":
+    <<: *test
+    docker:
+      - image: circleci/golang:1.7
+
+
+workflows:
+  version: 2
+  build:
+    jobs:
+      - "latest"
+      - "1.12"
+      - "1.11"
+      - "1.10"
+      - "1.9"
+      - "1.8"
+      - "1.7"
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index fe78007..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,20 +0,0 @@
-language: go
-sudo: false
-
-matrix:
-  include:
-    - go: 1.3
-    - go: 1.4
-    - go: 1.5
-    - go: 1.6
-    - go: 1.7
-    - go: 1.8
-    - go: tip
-  allow_failures:
-    - go: tip
-
-script:
-  - go get -t -v ./...
-  - diff -u <(echo -n) <(gofmt -d .)
-  - go vet $(go list ./... | grep -v /vendor/)
-  - go test -v -race ./...
diff --git a/README.md b/README.md
index e266555..9852d21 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,6 @@
 css
 ===
-[![GoDoc](https://godoc.org/github.com/gorilla/css?status.svg)](https://godoc.org/github.com/gorilla/css) [![Build Status](https://travis-ci.org/gorilla/css.png?branch=master)](https://travis-ci.org/gorilla/css)
+[![GoDoc](https://godoc.org/github.com/gorilla/css?status.svg)](https://godoc.org/github.com/gorilla/css)
+[![CircleCI](https://circleci.com/gh/gorilla/css.svg?style=svg)](https://circleci.com/gh/gorilla/css)
 
 A CSS3 tokenizer.
diff --git a/debian/changelog b/debian/changelog
index eb08077..cd77408 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+golang-github-gorilla-css (1.0.0+git20190626.1.4940b8d-1) UNRELEASED; urgency=low
+
+  * New upstream snapshot.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Tue, 26 Apr 2022 15:22:46 -0000
+
 golang-github-gorilla-css (1.0.0-2) unstable; urgency=medium
 
   * Source-only upload for migration.
diff --git a/scanner/scanner.go b/scanner/scanner.go
index 23fa740..25a7c65 100644
--- a/scanner/scanner.go
+++ b/scanner/scanner.go
@@ -191,7 +191,11 @@ func init() {
 // New returns a new CSS scanner for the given input.
 func New(input string) *Scanner {
 	// Normalize newlines.
+	// https://www.w3.org/TR/css-syntax-3/#input-preprocessing
 	input = strings.Replace(input, "\r\n", "\n", -1)
+	input = strings.Replace(input, "\r", "\n", -1)
+	input = strings.Replace(input, "\f", "\n", -1)
+	input = strings.Replace(input, "\u0000", "\ufffd", -1)
 	return &Scanner{
 		input: input,
 		row:   1,
@@ -232,7 +236,7 @@ func (s *Scanner) Next() *Token {
 	// shortcut before testing multiple regexps.
 	input := s.input[s.pos:]
 	switch input[0] {
-	case '\t', '\n', '\f', '\r', ' ':
+	case '\t', '\n', ' ':
 		// Whitespace.
 		return s.emitToken(TokenS, matchers[TokenS].FindString(input))
 	case '.':
diff --git a/scanner/scanner_test.go b/scanner/scanner_test.go
index c3411c5..c1ab243 100644
--- a/scanner/scanner_test.go
+++ b/scanner/scanner_test.go
@@ -73,3 +73,39 @@ func TestMatchers(t *testing.T) {
 	checkMatch("\uFEFF", TokenBOM, "\uFEFF")
 	checkMatch(`╯︵┻━┻"stuff"`, TokenIdent, "╯︵┻━┻", TokenString, `"stuff"`)
 }
+
+func TestPreprocess(t *testing.T) {
+	tcs := []struct{ desc, input, expected string }{
+		{
+			"CR",
+			".a{ \r color:red}",
+			".a{ \n color:red}",
+		},
+		{
+			"FF",
+			".a{ \f color:red}",
+			".a{ \n color:red}",
+		},
+		{
+			"CRLF",
+			".a{ \r\n color:red}",
+			".a{ \n color:red}",
+		},
+		{
+			"NULL",
+			".a{ \u0000 color:red}",
+			".a{ \ufffd color:red}",
+		},
+		{
+			"mixture",
+			".a{ \r\r\n\u0000\f color:red}",
+			".a{ \n\n\ufffd\n color:red}",
+		},
+	}
+	for _, tc := range tcs {
+		s := New(tc.input)
+		if s.input != tc.expected {
+			t.Errorf("%s: got=%q, want=%q", tc.desc, s.input, tc.expected)
+		}
+	}
+}

Publish Blockers

  • ☑ run was successful
  • ☑ package has not been removed from the archive
  • ☑ command has not changed
  • ☒ not yet reviewed, but review needed
  • ☑ 0 publish attempts so far.not currently attempting to back off
  • ☒ merge proposals for the package maintainer are currently being rate-limited (open: 1257, max open: 300)
  • ☑ change set e24602c1-cf80-48a2-9d5a-46ba22ffb195 is ready

Resulting package

The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:

apt install -t fresh-snapshots golang-github-gorilla-css-dev

Lintian Result

Full worker log Full build log