Skip to content

Commit 2d2ac79

Browse files
committed
Merge branch 'main' into xamgore-merged-main
2 parents f5cec80 + 0aab52b commit 2d2ac79

File tree

1,275 files changed

+119404
-107460
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,275 files changed

+119404
-107460
lines changed

.github/workflows/pr-checks.yaml

Lines changed: 41 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,16 @@ on:
77
- main
88
pull_request:
99

10-
jobs:
11-
test:
12-
name: cargo test
13-
runs-on: ubuntu-latest
14-
15-
steps:
16-
- uses: actions/checkout@v4
17-
- uses: actions-rust-lang/setup-rust-toolchain@v1
18-
- run: cargo build --tests --all-features
19-
- run: cargo test --all-features
20-
- run: cargo test --features unescape
21-
- run: cargo test --features entities
22-
- run: cargo test
23-
24-
fmt:
25-
name: cargo fmt
26-
runs-on: ubuntu-latest
27-
28-
steps:
29-
- uses: actions/checkout@v4
30-
- uses: actions-rust-lang/setup-rust-toolchain@v1
31-
with:
32-
components: rustfmt
33-
- uses: actions-rust-lang/rustfmt@v1
10+
env:
11+
CLICOLOR: 1
3412

13+
jobs:
3514
clippy:
3615
name: cargo clippy
3716
runs-on: ubuntu-latest
3817

3918
steps:
40-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@v5
4120
- uses: actions-rust-lang/setup-rust-toolchain@v1
4221
with:
4322
components: clippy
@@ -52,17 +31,52 @@ jobs:
5231
runs-on: ubuntu-latest
5332

5433
steps:
55-
- uses: actions/checkout@v4
34+
- uses: actions/checkout@v5
5635
- uses: EmbarkStudios/cargo-deny-action@v2
36+
with:
37+
rust-version: "1.85.0"
38+
39+
fmt:
40+
name: cargo fmt
41+
runs-on: ubuntu-latest
42+
43+
steps:
44+
- uses: actions/checkout@v5
45+
- uses: actions-rust-lang/setup-rust-toolchain@v1
46+
with:
47+
components: rustfmt
48+
- uses: actions-rust-lang/rustfmt@v1
5749

5850
msrv:
5951
name: cargo msrv
6052
runs-on: ubuntu-latest
6153

6254
steps:
63-
- uses: actions/checkout@v4
55+
- uses: actions/checkout@v5
6456
- uses: Swatinem/rust-cache@v2
6557
- uses: taiki-e/install-action@v2
6658
with:
6759
tool: cargo-msrv
6860
- run: cargo msrv verify
61+
62+
test:
63+
name: cargo test
64+
runs-on: ubuntu-latest
65+
66+
steps:
67+
- uses: actions/checkout@v5
68+
- uses: actions-rust-lang/setup-rust-toolchain@v1
69+
- run: cargo build --tests --all-features
70+
- run: cargo test --all-features
71+
- run: cargo test --features unescape
72+
- run: cargo test --features unescape_fast
73+
- run: cargo test --features entities
74+
- run: cargo test
75+
76+
typos:
77+
name: typos
78+
runs-on: ubuntu-latest
79+
80+
steps:
81+
- uses: actions/checkout@v5
82+
- uses: crate-ci/typos@v1.38.1

.github/workflows/release.yaml

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
# Mostly copied from https://github.com/taiki-e/cargo-hack/blob/72a9fc95377c453a18026329577c59fa60bfa737/.github/workflows/release.yml
1+
# Mostly copied from https://github.com/taiki-e/cargo-hack/blob/main/.github/workflows/release.yml
22
name: Release
33

44
permissions:
5-
# TODO: once `releases: write` is supported, use it instead.
6-
contents: write
5+
contents: read
76

87
on:
98
push:
@@ -12,31 +11,20 @@ on:
1211

1312
env:
1413
CARGO_INCREMENTAL: 0
14+
CARGO_NET_GIT_FETCH_WITH_CLI: true
1515
CARGO_NET_RETRY: 10
1616
CARGO_TERM_COLOR: always
1717
RUST_BACKTRACE: 1
1818
RUSTFLAGS: -D warnings
1919
RUSTUP_MAX_RETRIES: 10
2020

21-
defaults:
22-
run:
23-
# Setting shell: bash explicitly activates pipefail
24-
shell: bash
25-
2621
jobs:
2722
create-release:
2823
if: github.repository_owner == 'danielparks'
2924
runs-on: ubuntu-latest
25+
permissions:
26+
contents: write
3027
steps:
31-
- uses: actions/checkout@v4
32-
with:
33-
persist-credentials: false
34-
- name: Install Rust
35-
run: rustup update stable --no-self-update
36-
- run: cargo package
37-
- uses: taiki-e/create-gh-release-action@v1
28+
- uses: danielparks/github-actions/create-release@main
3829
with:
39-
changelog: CHANGELOG.md
40-
title: Release $version
41-
branch: main
4230
token: ${{ secrets.GITHUB_TOKEN }}

.pre-commit-config.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v6.0.0
4+
hooks:
5+
- id: check-added-large-files
6+
args: ["--maxkb=1024"]
7+
- id: check-case-conflict
8+
- id: check-executables-have-shebangs
9+
- id: check-json
10+
- id: check-merge-conflict
11+
- id: check-shebang-scripts-are-executable
12+
- id: check-symlinks
13+
- id: check-toml
14+
- id: check-vcs-permalinks
15+
- id: check-xml
16+
- id: check-yaml
17+
- id: detect-private-key
18+
- id: mixed-line-ending
19+
args: ["--fix=no"]
20+
exclude: "^target/"
21+
- id: no-commit-to-branch
22+
- repo: https://github.com/crate-ci/typos
23+
rev: v1.38.1
24+
hooks:
25+
- id: typos
26+
args: []
27+
exclude: "^target/"
28+
- repo: local
29+
hooks:
30+
- id: cargo clippy
31+
name: cargo clippy
32+
language: system
33+
entry: cargo clippy --all-targets --all-features -- -D warnings
34+
files: (\.rs|Cargo\.toml)$
35+
pass_filenames: false
36+
- id: cargo doc
37+
name: cargo doc
38+
language: system
39+
entry: sh -c 'RUSTDOCFLAGS=-Dwarnings cargo doc --all-features --workspace --no-deps --document-private-items'
40+
files: \.rs$
41+
pass_filenames: false
42+
- id: cargo fmt
43+
name: cargo fmt
44+
language: system
45+
entry: cargo fmt --check
46+
files: (\.rs|rustfmt\.toml)$
47+
pass_filenames: false

.typos.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[files]
2+
extend-exclude = [
3+
"target",
4+
"entities.json",
5+
"tests/corpus",
6+
]

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@ All notable changes to this project will be documented in this file.
44

55
## main branch
66

7+
* Major performance improvements when unescaping text in many cases (for both
8+
the `unescape` and `unescape_fast` features).
9+
* Major improvements in build time for the `unescape_fast` features (went from
10+
8 seconds to 3 seconds on my laptop).
11+
* Add `BARE_ENTITY_MAX_LENGTH` constant that contains the length of the longest
12+
entity without a semicolon (enabled with feature `entities`).
13+
* Clarify examples in documentation and README.
14+
* Fix a few spelling mistakes in documentation.
15+
16+
## Release 1.0.6 (2025-04-26)
17+
18+
* Switch dependency from [paste], which is no longer maintained, to a new fork,
19+
[pastey], which is.
20+
21+
[paste]: https://github.com/dtolnay/paste
22+
[pastey]: https://github.com/as1100k/pastey
23+
724
## Release 1.0.5 (2024-03-14)
825

926
* Exclude more files from final package to significantly reduce package size.

Cargo.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[package]
22
name = "htmlize"
3-
version = "1.0.5"
3+
version = "1.0.6"
44
authors = ["Daniel Parks <oss-htmlize@demonhorse.org>"]
5-
description = "Encode and decode HTML entities in UTF-8 according to the standard"
5+
description = "Correctly encode and decode HTML entities in UTF-8"
66
homepage = "https://github.com/danielparks/htmlize"
77
repository = "https://github.com/danielparks/htmlize"
88
readme = "README.md"
@@ -30,14 +30,14 @@ bench = []
3030
_unescape_either = []
3131

3232
[build-dependencies]
33-
matchgen = { version = "0.3.0", optional = true }
33+
matchgen = { version = "0.4.0", optional = true }
3434
phf = { version = "0.11.1", default-features = false, optional = true }
3535
phf_codegen = { version = "0.11.1", optional = true }
3636
serde_json = { version = "1.0", optional = true }
3737

3838
[dependencies]
3939
memchr = "2.5.0"
40-
paste = "1.0.11"
40+
pastey = "0.1.0"
4141
phf = { version = "0.11.1", default-features = false, optional = true }
4242
hashify = "0.2.6"
4343

@@ -81,6 +81,8 @@ pedantic = { level = "warn", priority = -1 }
8181
missing_docs_in_private_items = "warn"
8282

8383
# Other restriction lints
84+
allow_attributes = "warn"
85+
allow_attributes_without_reason = "warn"
8486
arithmetic_side_effects = "warn"
8587
as_underscore = "warn"
8688
assertions_on_result_states = "warn"
@@ -104,7 +106,6 @@ rc_mutex = "warn"
104106
same_name_method = "warn"
105107
semicolon_inside_block = "warn"
106108
str_to_string = "warn"
107-
string_to_string = "warn"
108109
undocumented_unsafe_blocks = "warn"
109110
unnecessary_safety_doc = "warn"
110111
unnecessary_self_imports = "warn"
@@ -116,6 +117,7 @@ let_underscore_untyped = "allow"
116117
manual_string_new = "allow"
117118
map_unwrap_or = "allow"
118119
module_name_repetitions = "allow"
120+
unnecessary_debug_formatting = "allow" # display() doesn’t escape invalid chars
119121

120122
# Nursery exceptions
121123
option_if_let_else = "allow"

Dockerfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@ RUN apt-get update \
77
&& apt-get install -y locales curl valgrind build-essential \
88
&& rm -rf /var/lib/apt/lists/* \
99
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
10-
ENV LANG en_US.utf8
11-
12-
# Remove after Rust 1.70 when this becomes default
13-
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
10+
ENV LANG=en_US.utf8
1411

1512
# Install rustup, rust, and cargo-binstall
1613
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \

0 commit comments

Comments
 (0)