Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/pr-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
- main
pull_request:

env:
CLICOLOR: 1

jobs:
clippy:
name: cargo clippy
Expand Down Expand Up @@ -68,3 +71,11 @@ jobs:
- run: cargo test --features unescape
- run: cargo test --features entities
- run: cargo test

typos:
name: typos
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5
- uses: crate-ci/typos@v1.38.1
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ repos:
- id: mixed-line-ending
args: ["--fix=no"]
- id: no-commit-to-branch
- repo: https://github.com/crate-ci/typos
rev: v1.38.1
hooks:
- id: typos
args: []
- repo: local
hooks:
- id: cargo clippy
Expand Down
6 changes: 6 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[files]
extend-exclude = [
"target",
"entities.json",
"tests/corpus",
]
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file.
## main branch

* Clarify examples in documentation and README.
* Fix a few spelling mistakes in documentation.

## Release 1.0.6 (2025-04-26)

Expand Down
8 changes: 4 additions & 4 deletions src/unescape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ include!(concat!(env!("OUT_DIR"), "/matcher.rs"));
/// point to the next character after the entity.
/// * It doesn’t find a match: returns `None` and `iter` is updated to point
/// to the next character than could plausibly start an entity (not
/// necessarily b'&', though; the only gaurantee is that we didn’t skip a
/// necessarily b'&', though; the only guarantee is that we didn’t skip a
/// potential entity).
///
/// This version uses matchgen instead of the `ENTITIES` map. It is faster at
Expand Down Expand Up @@ -375,7 +375,7 @@ const PEEK_MATCH_ERROR: &str = "iter.next() did not match previous peek(iter)";
/// point to the next character after the entity.
/// * It doesn’t find a match: returns `None` and `iter` is updated to point
/// to the next character than could plausibly start an entity (not
/// necessarily b'&', though; the only gaurantee is that we didn’t skip a
/// necessarily b'&', though; the only guarantee is that we didn’t skip a
/// potential entity).
///
/// This version uses the [`ENTITIES`] map instead of matchgen. It is slower at
Expand Down Expand Up @@ -500,8 +500,8 @@ fn match_entity_slow<'a>(
fn match_numeric_entity(
iter: &mut slice::Iter<u8>,
) -> Option<Cow<'static, [u8]>> {
assert_next_eq(iter, Some(b'&'), "match_numeric_entity() expexted '&'");
assert_next_eq(iter, Some(b'#'), "match_numeric_entity() expexted '#'");
assert_next_eq(iter, Some(b'&'), "match_numeric_entity() expected '&'");
assert_next_eq(iter, Some(b'#'), "match_numeric_entity() expected '#'");

let number = match peek(iter) {
c @ Some(b'x' | b'X') => {
Expand Down