Skip to content

Commit b0402c2

Browse files
committed
Rewrite URLs using the https scheme to http
We assume HSTS and/or HTTP->HTTPS redirection for resources we link, while keeping the `http` scheme as canonical.
1 parent b930beb commit b0402c2

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

expand/csspring/syntax/tokenizing.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def next(n: int) -> str:
4646
def consume(n: int) -> None:
4747
"""Consume the next code point from the stream.
4848
49-
Consuming removes a [filtered] code point from the stream. If no code points are available for consumption (the stream is "exhausted"), an empty string signifying the so-called EOF ("end of file", see https://drafts.csswg.org/css-syntax/#eof-code-point) value, is consumed instead.
49+
Consuming removes a [filtered] code point from the stream. If no code points are available for consumption (the stream is "exhausted"), an empty string signifying the so-called EOF ("end of file", see http://drafts.csswg.org/css-syntax/#eof-code-point) value, is consumed instead.
5050
"""
5151
nonlocal consumed # required for the `+=` to work for mutable non-locals like lists (despite the fact that the equivalent `extend` does _not_ require the statement)
5252
consumed += input.read(n) or [ FilteredCodePoint('', source='') ]

src/csspring/selectors.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def parse(production: Production, input: TokenStream) -> Product | Token | None:
3232

3333
@parse.register
3434
def _(production: AlternativesProduction, input: TokenStream) -> Product | Token | None:
35-
"""Variant of `parse` for productions of the `|` combinator variety (see https://drafts.csswg.org/css-values-4/#component-combinators)."""
35+
"""Variant of `parse` for productions of the `|` combinator variety (see http://drafts.csswg.org/css-values-4/#component-combinators)."""
3636
input.mark()
3737
for element in production.elements:
3838
result = parse(element, input)
@@ -69,7 +69,7 @@ def parse_any_value(input: TokenStream) -> Product | None:
6969

7070
@parse.register
7171
def _(production: CommaSeparatedRepetitionProduction, input: TokenStream) -> Product | None:
72-
"""Variant of `parse` for productions of the `#` multiplier variety (see https://drafts.csswg.org/css-values-4/#mult-comma)."""
72+
"""Variant of `parse` for productions of the `#` multiplier variety (see http://drafts.csswg.org/css-values-4/#mult-comma)."""
7373
result: list[Product | Token] = []
7474
input.mark()
7575
while True:
@@ -92,7 +92,7 @@ def _(production: CommaSeparatedRepetitionProduction, input: TokenStream) -> Pro
9292

9393
@parse.register
9494
def _(production: ConcatenationProduction, input: TokenStream) -> Product | None:
95-
"""Variant of `parse` for productions of the ` ` combinator variety (see "juxtaposing components" at https://drafts.csswg.org/css-values-4/#component-combinators)."""
95+
"""Variant of `parse` for productions of the ` ` combinator variety (see "juxtaposing components" at http://drafts.csswg.org/css-values-4/#component-combinators)."""
9696
result: list[Product | Token] = []
9797
input.mark()
9898
for element in production.elements:
@@ -105,7 +105,7 @@ def _(production: ConcatenationProduction, input: TokenStream) -> Product | None
105105

106106
@parse.register
107107
def _(production: NonEmptyProduction, input: TokenStream) -> Product | None:
108-
"""Variant of `parse` for productions of the `!` multiplier variety (see https://drafts.csswg.org/css-values-4/#mult-req)."""
108+
"""Variant of `parse` for productions of the `!` multiplier variety (see http://drafts.csswg.org/css-values-4/#mult-req)."""
109109
result = cast(Product, parse(production.element, input)) # The element of a non-empty production is concatenation, and the `parse` overload for `ConcatenationProduction` never returns a `Token`, only `Product | None`
110110
if result and any(tokens(result)):
111111
return result
@@ -143,7 +143,7 @@ def _(production: RepetitionProduction, input: TokenStream) -> Product | None:
143143
def _(production: TokenProduction, input: TokenStream) -> Token | None:
144144
"""Variant of `parse` for token productions.
145145
146-
A token production can be identified in the grammar at https://drafts.csswg.org/selectors-4/#grammar with the `<...-token>` text.
146+
A token production can be identified in the grammar at http://drafts.csswg.org/selectors-4/#grammar with the `<...-token>` text.
147147
"""
148148
input.mark()
149149
if isinstance(token := input.consume_token(), production.type) and all((getattr(token, name) == value) for name, value in production.attributes.items()):

src/csspring/syntax/grammar.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

44
from ..values import Production
55

6-
# See https://drafts.csswg.org/css-syntax/#any-value
6+
# See http://drafts.csswg.org/css-syntax/#any-value
77
any_value = Production()
88
any_value.name = 'any_value'

src/csspring/values.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Implement the ["CSS Values and Units Module Level 4"](https://drafts.csswg.org/css-values-4) specification.
1+
"""Implement the ["CSS Values and Units Module Level 4"](http://drafts.csswg.org/css-values-4) specification.
22
33
Only parts currently in use by the rest of the `csspring` pcakge, are implemented.
44
"""
@@ -135,7 +135,7 @@ def __init__(self, element: Production):
135135
self.element = element
136136

137137
class Formatter:
138-
"""Class of objects that offer procedures for serializing productions into streams of text formatted per the [value definition syntax](https://drafts.csswg.org/css-values-4/#value-defs)."""
138+
"""Class of objects that offer procedures for serializing productions into streams of text formatted per the [value definition syntax](http://drafts.csswg.org/css-values-4/#value-defs)."""
139139
grouping_strings = ('[ ', ' ]') # The kind of grouping symbol to use when a production expression must be surrounded with a pair of brace-like grouping symbols, in its serialized form
140140
def grouping_mode(self, production: Production):
141141
"""Determine whether a given production shall require an explicit pair of grouping symbols when featured as an _operand_ (e.g. in binary/unary operation context).

0 commit comments

Comments
 (0)