From 069cb40f533e5b5acd301dd94af67a0fba9f49e6 Mon Sep 17 00:00:00 2001 From: Philip Sampaio Date: Fri, 27 Dec 2024 12:50:12 -0300 Subject: [PATCH] Add Elixir 1.18 to the CI workflow (#607) * Add Elixir 1.18 to the CI workflow * Use available OTP version --- .github/workflows/ci.yml | 20 ++++++++++---------- lib/floki/html/tokenizer.ex | 5 ++++- lib/floki/html_parser/fast_html.ex | 4 +++- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ea798111..4a8aa8a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,33 +8,33 @@ on: jobs: test: - runs-on: ubuntu-20.04 - name: Elixir ${{ matrix.elixir }} / OTP ${{ matrix.otp }} with ${{ matrix.parser }} + runs-on: ubuntu-22.04 + name: Elixir ${{ matrix.elixir }} / OTP ${{ matrix.otp }} / ${{ matrix.parser }} strategy: fail-fast: false matrix: - elixir: ["1.17", "1.14"] - otp: ["27.1", "23.3"] + elixir: ["1.18", "1.14"] + otp: ["27.2", "24.2"] parser: [fast_html, html5ever, mochiweb] exclude: - - elixir: "1.17" - otp: "23.3" + - elixir: "1.18" + otp: "24.2" - elixir: "1.14" - otp: "27.1" + otp: "27.2" steps: - uses: actions/checkout@v4 - uses: erlef/setup-beam@v1 with: - otp-version: ${{matrix.otp}} - elixir-version: ${{matrix.elixir}} + otp-version: ${{ matrix.otp }} + elixir-version: ${{ matrix.elixir }} - name: Check format run: mix format --check-formatted - if: matrix.elixir == '1.17' + if: matrix.elixir == '1.18' - name: Install dependencies run: mix deps.get diff --git a/lib/floki/html/tokenizer.ex b/lib/floki/html/tokenizer.ex index acb87e5b..41b0405e 100644 --- a/lib/floki/html/tokenizer.ex +++ b/lib/floki/html/tokenizer.ex @@ -2673,7 +2673,10 @@ defmodule Floki.HTML.Tokenizer do character_reference_end(html, %{state | buffer: buffer}) end - defp character_buffer(%State{charref_state: %CharrefState{candidate: candidate}, buffer: buffer}) do + defp character_buffer(%State{ + charref_state: %CharrefState{candidate: candidate}, + buffer: buffer + }) do if candidate do Floki.Entities.Codepoints.get(candidate) else diff --git a/lib/floki/html_parser/fast_html.ex b/lib/floki/html_parser/fast_html.ex index 33229ce7..04e7a43a 100644 --- a/lib/floki/html_parser/fast_html.ex +++ b/lib/floki/html_parser/fast_html.ex @@ -9,7 +9,9 @@ defmodule Floki.HTMLParser.FastHtml do @impl true def parse_fragment(html, args) do - execute_with_module(fn module -> module.decode_fragment(IO.chardata_to_string(html), args) end) + execute_with_module(fn module -> + module.decode_fragment(IO.chardata_to_string(html), args) + end) end @impl true