html-to-markdown 2.26.3 → 2.27.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,8 +26,6 @@
26
26
  * // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27
27
  * // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
28
  */
29
- use num_traits::MulAdd;
30
- use std::ops::{Add, Mul};
31
29
 
32
30
  #[inline(always)]
33
31
  pub(crate) fn is_integerf(x: f32) -> bool {
@@ -150,38 +148,6 @@ pub(crate) fn is_odd_integer(x: f64) -> bool {
150
148
  }
151
149
  }
152
150
 
153
- #[cfg(any(
154
- all(
155
- any(target_arch = "x86", target_arch = "x86_64"),
156
- target_feature = "fma"
157
- ),
158
- target_arch = "aarch64"
159
- ))]
160
- #[inline(always)]
161
- pub(crate) fn mlaf<T: Copy + Mul<T, Output = T> + Add<T, Output = T> + MulAdd<T, Output = T>>(
162
- acc: T,
163
- a: T,
164
- b: T,
165
- ) -> T {
166
- MulAdd::mul_add(a, b, acc)
167
- }
168
-
169
- #[inline(always)]
170
- #[cfg(not(any(
171
- all(
172
- any(target_arch = "x86", target_arch = "x86_64"),
173
- target_feature = "fma"
174
- ),
175
- target_arch = "aarch64"
176
- )))]
177
- pub(crate) fn mlaf<T: Copy + Mul<T, Output = T> + Add<T, Output = T> + MulAdd<T, Output = T>>(
178
- acc: T,
179
- a: T,
180
- b: T,
181
- ) -> T {
182
- acc + a * b
183
- }
184
-
185
151
  #[inline]
186
152
  pub(crate) const fn rintfk(x: f32) -> f32 {
187
153
  (if x < 0. { x - 0.5 } else { x + 0.5 }) as i32 as f32
@@ -330,16 +296,6 @@ pub(crate) fn dd_fmlaf(a: f32, b: f32, c: f32) -> f32 {
330
296
  }
331
297
  }
332
298
 
333
- #[allow(dead_code)]
334
- #[inline(always)]
335
- pub(crate) fn c_mlaf<T: Copy + Mul<T, Output = T> + Add<T, Output = T> + MulAdd<T, Output = T>>(
336
- a: T,
337
- b: T,
338
- c: T,
339
- ) -> T {
340
- mlaf(c, a, b)
341
- }
342
-
343
299
  /// Copies sign from `y` to `x`
344
300
  #[inline]
345
301
  pub const fn copysignfk(x: f32, y: f32) -> f32 {
@@ -216,7 +216,8 @@ pub fn f_pow(x: f64, y: f64) -> f64 {
216
216
  return if y_sign { 0. } else { f64::INFINITY };
217
217
  }
218
218
  // not enough precision to make 0.5 ULP for subnormals
219
- if x_e.abs() < 70 {
219
+ let a_xe = x_e & 0x7fff_ffff_ffff_ffff;
220
+ if a_xe < 70 {
220
221
  let x_sqr = DoubleDouble::from_exact_mult(x, x);
221
222
  return if y_sign {
222
223
  let recip = x_sqr.recip();
@@ -413,6 +413,7 @@ fn powf_dd<B: PowfBackend>(
413
413
  }
414
414
 
415
415
  #[inline(always)]
416
+ #[allow(clippy::manual_clamp)]
416
417
  fn powf_gen<B: PowfBackend>(x: f32, y: f32, backend: B) -> f32 {
417
418
  let mut x_u = x.to_bits();
418
419
  let x_abs = x_u & 0x7fff_ffff;
@@ -32,7 +32,7 @@ use crate::tangent::tanpi::tanpi_eval;
32
32
  use crate::tangent::tanpi_table::TANPI_K_PI_OVER_64;
33
33
 
34
34
  #[cold]
35
- fn cotpi_hard(x: f64, tan_k: DoubleDouble) -> DoubleDouble {
35
+ fn cotpi_hard<B: SinCosPiBackend>(x: f64, tan_k: DoubleDouble, backend: &B) -> DoubleDouble {
36
36
  const C: [(u64, u64); 6] = [
37
37
  (0x3ca1a62632712fc8, 0x400921fb54442d18),
38
38
  (0xbcc052338fbb4528, 0x4024abbce625be53),
@@ -41,24 +41,24 @@ fn cotpi_hard(x: f64, tan_k: DoubleDouble) -> DoubleDouble {
41
41
  (0x3d205970eff53274, 0x40845f46e96c3a0b),
42
42
  (0xbd3589489ad24fc4, 0x40a4630551cd123d),
43
43
  ];
44
- let x2 = DoubleDouble::from_exact_mult(x, x);
45
- let mut tan_y = DoubleDouble::quick_mul_add(
44
+ let x2 = backend.exact_mult(x, x);
45
+ let mut tan_y = backend.quick_mul_add(
46
46
  x2,
47
47
  DoubleDouble::from_bit_pair(C[5]),
48
48
  DoubleDouble::from_bit_pair(C[4]),
49
49
  );
50
- tan_y = DoubleDouble::quick_mul_add(x2, tan_y, DoubleDouble::from_bit_pair(C[3]));
51
- tan_y = DoubleDouble::quick_mul_add(x2, tan_y, DoubleDouble::from_bit_pair(C[2]));
52
- tan_y = DoubleDouble::quick_mul_add(x2, tan_y, DoubleDouble::from_bit_pair(C[1]));
53
- tan_y = DoubleDouble::quick_mul_add(x2, tan_y, DoubleDouble::from_bit_pair(C[0]));
54
- tan_y = DoubleDouble::quick_mult_f64(tan_y, x);
50
+ tan_y = backend.quick_mul_add(x2, tan_y, DoubleDouble::from_bit_pair(C[3]));
51
+ tan_y = backend.quick_mul_add(x2, tan_y, DoubleDouble::from_bit_pair(C[2]));
52
+ tan_y = backend.quick_mul_add(x2, tan_y, DoubleDouble::from_bit_pair(C[1]));
53
+ tan_y = backend.quick_mul_add(x2, tan_y, DoubleDouble::from_bit_pair(C[0]));
54
+ tan_y = backend.quick_mult_f64(tan_y, x);
55
55
 
56
56
  // num = tan(y*pi/64) + tan(k*pi/64)
57
57
  let num = DoubleDouble::full_dd_add(tan_y, tan_k);
58
58
  // den = 1 - tan(y*pi/64)*tan(k*pi/64)
59
- let den = DoubleDouble::mul_add_f64(tan_y, -tan_k, 1.);
59
+ let den = backend.mul_add_f64(tan_y, -tan_k, 1.);
60
60
  // cot = den / num
61
- DoubleDouble::div(den, num)
61
+ backend.div(den, num)
62
62
  }
63
63
 
64
64
  #[inline(always)]
@@ -151,7 +151,7 @@ fn cotpi_gen_impl<B: SinCosPiBackend>(x: f64, backend: B) -> f64 {
151
151
  if ub == lb {
152
152
  return tan_value.to_f64();
153
153
  }
154
- cotpi_hard(y, tan_k).to_f64()
154
+ cotpi_hard(y, tan_k, &backend).to_f64()
155
155
  }
156
156
 
157
157
  #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: html-to-markdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.26.3
4
+ version: 2.27.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Na'aman Hirschfeld
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-02-28 00:00:00.000000000 Z
11
+ date: 2026-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rb_sys
@@ -1852,6 +1852,7 @@ files:
1852
1852
  - rust-vendor/html-to-markdown-rs/src/converter/media/svg.rs
1853
1853
  - rust-vendor/html-to-markdown-rs/src/converter/metadata.rs
1854
1854
  - rust-vendor/html-to-markdown-rs/src/converter/mod.rs
1855
+ - rust-vendor/html-to-markdown-rs/src/converter/plain_text.rs
1855
1856
  - rust-vendor/html-to-markdown-rs/src/converter/preprocessing_helpers.rs
1856
1857
  - rust-vendor/html-to-markdown-rs/src/converter/semantic/attributes.rs
1857
1858
  - rust-vendor/html-to-markdown-rs/src/converter/semantic/definition_list.rs
@@ -1949,6 +1950,7 @@ files:
1949
1950
  - rust-vendor/html-to-markdown-rs/tests/issue_212_regressions.rs
1950
1951
  - rust-vendor/html-to-markdown-rs/tests/json_ld_script_extraction.rs
1951
1952
  - rust-vendor/html-to-markdown-rs/tests/lists_test.rs
1953
+ - rust-vendor/html-to-markdown-rs/tests/plain_output_test.rs
1952
1954
  - rust-vendor/html-to-markdown-rs/tests/preprocessing_tests.rs
1953
1955
  - rust-vendor/html-to-markdown-rs/tests/skip_images_test.rs
1954
1956
  - rust-vendor/html-to-markdown-rs/tests/tables_test.rs