14 | Test document title
15 |
16 | Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
17 | tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
18 | quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
19 | consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
20 | cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
21 | proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
22 |
23 |
24 | Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
25 | tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
26 | quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
27 | consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
28 | cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
29 | proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/test-pages/readability/remove-script-tags/source.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 | Lorem
11 |
12 |
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
13 | tempor incididunt ut labore et dolore magna aliqua.
14 |
Ut enim ad minim veniam,
15 | quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
16 | consequat.
17 |
20 |
Duis aute irure dolor in reprehenderit in voluptate velit esse
21 | cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
22 | proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
23 |
24 |
27 | Foo
28 |
29 |
Tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
30 | quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
31 | consequat.
32 |
33 |
Duis aute irure dolor in reprehenderit in voluptate velit esse
34 | cillum dolore eu fugiat nulla pariatur.
35 |
38 | Excepteur sint occaecat cupidatat non
39 | proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/tests/bad.rs:
--------------------------------------------------------------------------------
1 | use dom_smoothie::Readability;
2 |
3 | #[test]
4 | fn test_skip_body_ancestor() {
5 | let contents = r#"
6 |
7 |
8 |
9 |
2 |
Regarding item# 11111, under sufficiently extreme conditions, quarks may become deconfined and exist as free particles. In the course of asymptotic freedom, the strong interaction becomes weaker at higher temperatures. Eventually, color confinement would be lost and an extremely hot plasma of freely moving quarks and gluons would be formed. This theoretical phase of matter is called quark-gluon plasma.[81] The exact conditions needed to give rise to this state are unknown and have been the subject of a great deal of speculation and experimentation.
3 |
Regarding item# 22222, under sufficiently extreme conditions, quarks may become deconfined and exist as free particles. In the course of asymptotic freedom, the strong interaction becomes weaker at higher temperatures. Eventually, color confinement would be lost and an extremely hot plasma of freely moving quarks and gluons would be formed. This theoretical phase of matter is called quark-gluon plasma.[81] The exact conditions needed to give rise to this state are unknown and have been the subject of a great deal of speculation and experimentation.
4 |
Regarding item# 33333, under sufficiently extreme conditions, quarks may become deconfined and exist as free particles. In the course of asymptotic freedom, the strong interaction becomes weaker at higher temperatures. Eventually, color confinement would be lost and an extremely hot plasma of freely moving quarks and gluons would be formed. This theoretical phase of matter is called quark-gluon plasma.[81] The exact conditions needed to give rise to this state are unknown and have been the subject of a great deal of speculation and experimentation.
5 |
6 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: Build and Release Binaries
2 |
3 | on:
4 | release:
5 | types: [published]
6 |
7 | workflow_dispatch:
8 |
9 | permissions:
10 | contents: write
11 |
12 | jobs:
13 | build-and-upload:
14 | name: Build and upload
15 |
16 | strategy:
17 | matrix:
18 | include:
19 | - os: ubuntu-latest
20 | target: x86_64-unknown-linux-gnu
21 | src_file: dom_smoothie_cli
22 | dst_file: dom_smoothie_cli-x86_64-unknown-linux-gnu-${{ github.ref_name }}
23 |
24 | - os: macos-latest
25 | target: x86_64-apple-darwin
26 | src_file: dom_smoothie_cli
27 | dst_file: dom_smoothie_cli-x86_64-apple-darwin-${{ github.ref_name }}
28 |
29 | - os: windows-latest
30 | target: x86_64-pc-windows-gnu
31 | src_file: dom_smoothie_cli.exe
32 | dst_file: dom_smoothie_cli-x86_64-pc-windows-gnu-${{ github.ref_name }}
33 |
34 | runs-on: ${{ matrix.os }}
35 |
36 | steps:
37 | - uses: actions/checkout@v4
38 |
39 | - name: Install Rust
40 | uses: dtolnay/rust-toolchain@stable
41 | with:
42 | targets: ${{ matrix.target }}
43 |
44 | - name: Build Binary
45 | run: cargo build --release --target ${{ matrix.target }}
46 | working-directory: crates/cli
47 |
48 | - name: Install zip (Windows)
49 | if: matrix.os == 'windows-latest'
50 | run: choco install zip -y
51 |
52 | - name: Prepare Archive
53 | run: |
54 | zip -j ${{ matrix.dst_file }}.zip target/${{ matrix.target }}/release/${{ matrix.src_file }}
55 |
56 | - name: Release
57 | uses: softprops/action-gh-release@v1
58 | with:
59 | files: |
60 | ${{ matrix.dst_file }}.zip
61 |
--------------------------------------------------------------------------------
/tests/parse_policy.rs:
--------------------------------------------------------------------------------
1 | use dom_smoothie::{ParsePolicy, Readability};
2 |
3 | use std::collections::hash_map::DefaultHasher;
4 | use std::error::Error;
5 | use std::hash::{Hash, Hasher};
6 |
7 | fn hash_text