html-to-markdown 2.24.1 → 2.24.3
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +9 -6
- data/ext/html-to-markdown-rb/native/Cargo.lock +13 -13
- data/ext/html-to-markdown-rb/native/Cargo.toml +1 -1
- data/lib/html_to_markdown/version.rb +1 -1
- data/rust-vendor/bytemuck/.cargo-checksum.json +1 -1
- data/rust-vendor/bytemuck/.cargo_vcs_info.json +1 -1
- data/rust-vendor/bytemuck/.github/workflows/rust.yml +4 -4
- data/rust-vendor/bytemuck/Cargo.lock +16 -9
- data/rust-vendor/bytemuck/Cargo.toml +6 -2
- data/rust-vendor/bytemuck/Cargo.toml.orig +7 -6
- data/rust-vendor/bytemuck/changelog.md +5 -0
- data/rust-vendor/bytemuck/src/must.rs +1 -1
- data/rust-vendor/bytemuck/src/pod.rs +13 -0
- data/rust-vendor/bytemuck/src/zeroable.rs +13 -0
- data/rust-vendor/bytemuck/src/zeroable_in_option.rs +2 -2
- data/rust-vendor/bytemuck/tests/std_tests.rs +1 -1
- data/rust-vendor/cc/.cargo-checksum.json +1 -1
- data/rust-vendor/cc/.cargo_vcs_info.json +1 -1
- data/rust-vendor/cc/CHANGELOG.md +8 -0
- data/rust-vendor/cc/Cargo.lock +3 -3
- data/rust-vendor/cc/Cargo.toml +2 -2
- data/rust-vendor/cc/Cargo.toml.orig +2 -2
- data/rust-vendor/cc/src/lib.rs +1 -0
- data/rust-vendor/cc/src/target/generated.rs +10 -0
- data/rust-vendor/find-msvc-tools/.cargo-checksum.json +1 -1
- data/rust-vendor/find-msvc-tools/.cargo_vcs_info.json +1 -1
- data/rust-vendor/find-msvc-tools/CHANGELOG.md +6 -0
- data/rust-vendor/find-msvc-tools/Cargo.lock +1 -1
- data/rust-vendor/find-msvc-tools/Cargo.toml +1 -1
- data/rust-vendor/find-msvc-tools/Cargo.toml.orig +1 -1
- data/rust-vendor/find-msvc-tools/src/find_tools.rs +55 -20
- data/rust-vendor/html-to-markdown-rs/src/converter/handlers/link.rs +1 -9
- data/rust-vendor/html-to-markdown-rs/src/converter/inline/link.rs +2 -11
- data/rust-vendor/html-to-markdown-rs/src/converter/list/definition.rs +30 -7
- data/rust-vendor/html-to-markdown-rs/src/converter/semantic/definition_list.rs +30 -7
- data/rust-vendor/html-to-markdown-rs/tests/issue_199_regressions.rs +15 -0
- data/rust-vendor/html-to-markdown-rs/tests/issue_200_regressions.rs +36 -0
- data/rust-vendor/zerocopy/.cargo-checksum.json +1 -1
- data/rust-vendor/zerocopy/.cargo_vcs_info.json +2 -1
- data/rust-vendor/zerocopy/Cargo.lock +3 -3
- data/rust-vendor/zerocopy/Cargo.toml +4 -4
- data/rust-vendor/zerocopy/Cargo.toml.orig +4 -4
- data/rust-vendor/zerocopy/src/doctests.rs +27 -0
- data/rust-vendor/zerocopy/src/error.rs +30 -0
- data/rust-vendor/zerocopy/src/layout.rs +239 -135
- data/rust-vendor/zerocopy/src/lib.rs +16 -0
- data/rust-vendor/zerocopy/src/macros.rs +255 -125
- data/rust-vendor/zerocopy/src/pointer/mod.rs +1 -1
- data/rust-vendor/zerocopy/src/pointer/ptr.rs +109 -23
- data/rust-vendor/zerocopy/src/util/macro_util.rs +344 -383
- data/rust-vendor/zerocopy/src/util/mod.rs +38 -0
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-const.stderr +8 -0
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-dst-not-a-reference.stderr +10 -0
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-unsized.stderr +11 -3
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-dst-mutable.stderr +10 -0
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-dst-not-a-reference.stderr +10 -0
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-src-dst-not-references.stderr +10 -0
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-src-unsized.stderr +11 -3
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-dst-not-tryfrombytes.stderr +0 -10
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-dst-mutable.stderr +1 -1
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-dst-not-immutable-tryfrombytes.stderr +0 -10
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-src-not-immutable-intobytes.stderr +1 -11
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-const.stderr +9 -0
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-dst-not-a-reference.stderr +10 -0
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-unsized.stderr +16 -8
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-dst-mutable.stderr +10 -0
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-dst-not-a-reference.stderr +10 -0
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-src-dst-not-references.stderr +10 -0
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-src-unsized.stderr +16 -8
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-dst-not-tryfrombytes.stderr +38 -38
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-dst-not-immutable-tryfrombytes.stderr +33 -33
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-src-not-immutable-intobytes.stderr +12 -12
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-const.stderr +9 -0
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-dst-not-a-reference.stderr +10 -0
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-unsized.stderr +16 -8
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-dst-mutable.stderr +10 -0
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-dst-not-a-reference.stderr +10 -0
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-src-dst-not-references.stderr +10 -0
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-src-unsized.stderr +16 -8
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-dst-not-tryfrombytes.stderr +38 -38
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-dst-not-immutable-tryfrombytes.stderr +33 -33
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-src-not-immutable-intobytes.stderr +12 -12
- data/rust-vendor/zerocopy-derive/.cargo-checksum.json +1 -1
- data/rust-vendor/zerocopy-derive/.cargo_vcs_info.json +1 -1
- data/rust-vendor/zerocopy-derive/Cargo.lock +1 -1
- data/rust-vendor/zerocopy-derive/Cargo.toml +1 -1
- data/rust-vendor/zerocopy-derive/Cargo.toml.orig +1 -1
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/enum.stderr +3 -3
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/struct.stderr +5 -5
- data/rust-vendor/zerocopy-derive/tests/ui-stable/enum.stderr +3 -3
- data/rust-vendor/zerocopy-derive/tests/ui-stable/struct.stderr +5 -5
- data/rust-vendor/zmij/.cargo-checksum.json +1 -1
- data/rust-vendor/zmij/.cargo_vcs_info.json +1 -1
- data/rust-vendor/zmij/Cargo.lock +16 -16
- data/rust-vendor/zmij/Cargo.toml +1 -1
- data/rust-vendor/zmij/Cargo.toml.orig +1 -1
- data/rust-vendor/zmij/README.md +1 -1
- data/rust-vendor/zmij/src/lib.rs +54 -93
- metadata +4 -50
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-dst-unsized.rs +0 -15
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-dst-unsized.stderr +0 -8
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-dst-unsized.rs +0 -15
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-dst-unsized.stderr +0 -8
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-alignment-increase.rs +0 -19
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-alignment-increase.stderr +0 -9
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-size-decrease.rs +0 -19
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-size-decrease.stderr +0 -9
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-size-increase.rs +0 -19
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-size-increase.stderr +0 -17
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-alignment-increase.rs +0 -18
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-alignment-increase.stderr +0 -9
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-size-decrease.rs +0 -18
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-size-decrease.stderr +0 -9
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-size-increase.rs +0 -18
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-size-increase.stderr +0 -9
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-dst-unsized.rs +0 -15
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-dst-unsized.stderr +0 -16
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-dst-unsized.rs +0 -15
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-dst-unsized.stderr +0 -16
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-alignment-increase.rs +0 -19
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-alignment-increase.stderr +0 -9
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-size-decrease.rs +0 -19
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-size-decrease.stderr +0 -9
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-size-increase.rs +0 -19
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-size-increase.stderr +0 -17
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-alignment-increase.rs +0 -18
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-alignment-increase.stderr +0 -9
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-size-decrease.rs +0 -18
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-size-decrease.stderr +0 -9
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-size-increase.rs +0 -18
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-size-increase.stderr +0 -9
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-dst-unsized.rs +0 -15
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-dst-unsized.stderr +0 -16
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-dst-unsized.rs +0 -15
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-dst-unsized.stderr +0 -16
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-alignment-increase.rs +0 -19
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-alignment-increase.stderr +0 -9
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-size-decrease.rs +0 -19
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-size-decrease.stderr +0 -9
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-size-increase.rs +0 -19
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-size-increase.stderr +0 -17
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-alignment-increase.rs +0 -18
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-alignment-increase.stderr +0 -9
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-size-decrease.rs +0 -18
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-size-decrease.stderr +0 -9
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-size-increase.rs +0 -18
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-size-increase.stderr +0 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"files":{".cargo_vcs_info.json":"
|
|
1
|
+
{"files":{".cargo_vcs_info.json":"a6a00e4fc7a085688fcd4550501bc164e55a5f6b84225a5a744d4124dd493e3d","CHANGELOG.md":"d8241689c2a2901c42c6c2284659915ed85e4c36216c1d5d771fa0be9c64a4a9","Cargo.lock":"ee3c45e2461f086b0122abd500f2c55bf9d05876ea6323b951578080cd158838","Cargo.toml":"1162710613011a622ba62b035b570cc13584516082f9cf579cfaf2f144a77a76","Cargo.toml.orig":"3941ba1194442678125b6ca4221a07ac27ac64f7dadd7467490e55e39cc205f9","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"5e7b2b1f5ffc1da7695d3e151a2d4d0b8f681e65a24ddf85a353d4bcfa81967a","src/com.rs":"d71a248866e04a19c62221999f7f120890cb98bc74ea7fd0b714f766d3e0dd81","src/find_tools.rs":"4b97e6f518943d4754ac73c77bc5932025bd1b48d10ed310694ed7d7449ae256","src/lib.rs":"56b0350126ad84accee5fd3d160c6a04a32d17012013fc6f687caf4b59a76ce8","src/registry.rs":"ccbb665b60517a62d249dbe708675ea915c423c14bea786e17efee27453afd41","src/setup_config.rs":"5fee84b80d089ae4a92f10080b072ea2bb32c2edbcdc759cb9072e380404fc46","src/tool.rs":"83e805a8354278837c474c0907b8dd80c496ae4812b2f777f2b2e4266ba68032","src/vs_instances.rs":"10a4433ff6799b11dc01da568ba20af9153aa645d9dc4154cf1c0da15308577c","src/winapi.rs":"d486d80ebe222f3bf61bba50038cf63b258585325b29b89d149de8b5a489c2b5","src/windows_link.rs":"5b4648ebc22b028caca9f4b4bf8881fe2d094b7bec217264ba2e6e2c49d1ccee","src/windows_sys.rs":"c3c803c6408795eb3a2bb3feaf3dc83a8d3049d76f026a4d25d21162fdb890dd"},"package":"5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582"}
|
|
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.1.9](https://github.com/rust-lang/cc-rs/compare/find-msvc-tools-v0.1.8...find-msvc-tools-v0.1.9) - 2026-01-30
|
|
11
|
+
|
|
12
|
+
### Other
|
|
13
|
+
|
|
14
|
+
- Add `find_windows_sdk` API ([#1663](https://github.com/rust-lang/cc-rs/pull/1663))
|
|
15
|
+
|
|
10
16
|
## [0.1.8](https://github.com/rust-lang/cc-rs/compare/find-msvc-tools-v0.1.7...find-msvc-tools-v0.1.8) - 2026-01-16
|
|
11
17
|
|
|
12
18
|
### Other
|
|
@@ -18,7 +18,7 @@ use std::{
|
|
|
18
18
|
env,
|
|
19
19
|
ffi::{OsStr, OsString},
|
|
20
20
|
ops::Deref,
|
|
21
|
-
path::PathBuf,
|
|
21
|
+
path::{Path, PathBuf},
|
|
22
22
|
process::Command,
|
|
23
23
|
sync::Arc,
|
|
24
24
|
};
|
|
@@ -195,6 +195,46 @@ pub fn find_tool_with_env(full_arch: &str, tool: &str, env_getter: &dyn EnvGette
|
|
|
195
195
|
.or_else(|| impl_::find_msvc_14(tool, target, env_getter))
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
+
/// An SDK found by [`find_windows_sdk`]
|
|
199
|
+
#[derive(Default)]
|
|
200
|
+
pub struct Sdk {
|
|
201
|
+
libs: Vec<PathBuf>,
|
|
202
|
+
path: Vec<PathBuf>,
|
|
203
|
+
include: Vec<PathBuf>,
|
|
204
|
+
version: String,
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
impl Sdk {
|
|
208
|
+
/// Directories containing static libraries (e.g. `.lib` files).
|
|
209
|
+
pub fn libs(&self) -> impl Iterator<Item = &Path> {
|
|
210
|
+
self.libs.iter().map(PathBuf::as_path)
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/// Directories containing binaries (`.exe` and `.dll` files).
|
|
214
|
+
pub fn path(&self) -> impl Iterator<Item = &Path> {
|
|
215
|
+
self.path.iter().map(PathBuf::as_path)
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/// Directories containing source headers (e.g. `.h` files)
|
|
219
|
+
pub fn include(&self) -> impl Iterator<Item = &Path> {
|
|
220
|
+
self.include.iter().map(PathBuf::as_path)
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/// The Windows SDK version that was found.
|
|
224
|
+
pub fn sdk_version(&self) -> &str {
|
|
225
|
+
&self.version
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/// Find the directories of the latest installed Windows SDK.
|
|
230
|
+
///
|
|
231
|
+
/// It's not necessary to call this if using [`find`] or [`find_tool`] as they will populate the relvant
|
|
232
|
+
/// environment variables with the SDK directories.
|
|
233
|
+
pub fn find_windows_sdk(full_arch: &str) -> Option<Sdk> {
|
|
234
|
+
let target = TargetArch::new(full_arch)?;
|
|
235
|
+
impl_::get_sdks(target, &StdEnvGetter)
|
|
236
|
+
}
|
|
237
|
+
|
|
198
238
|
/// A version of Visual Studio
|
|
199
239
|
#[derive(Debug, PartialEq, Eq, Copy, Clone)]
|
|
200
240
|
#[non_exhaustive]
|
|
@@ -302,7 +342,7 @@ mod impl_ {
|
|
|
302
342
|
use std::sync::atomic::{AtomicBool, Ordering};
|
|
303
343
|
use std::sync::Once;
|
|
304
344
|
|
|
305
|
-
use super::{EnvGetter, TargetArch};
|
|
345
|
+
use super::{EnvGetter, Sdk, TargetArch};
|
|
306
346
|
use crate::Tool;
|
|
307
347
|
|
|
308
348
|
struct MsvcTool {
|
|
@@ -312,13 +352,6 @@ mod impl_ {
|
|
|
312
352
|
include: Vec<PathBuf>,
|
|
313
353
|
}
|
|
314
354
|
|
|
315
|
-
#[derive(Default)]
|
|
316
|
-
struct SdkInfo {
|
|
317
|
-
libs: Vec<PathBuf>,
|
|
318
|
-
path: Vec<PathBuf>,
|
|
319
|
-
include: Vec<PathBuf>,
|
|
320
|
-
}
|
|
321
|
-
|
|
322
355
|
struct LibraryHandle(HMODULE);
|
|
323
356
|
|
|
324
357
|
impl LibraryHandle {
|
|
@@ -392,7 +425,7 @@ mod impl_ {
|
|
|
392
425
|
}
|
|
393
426
|
}
|
|
394
427
|
|
|
395
|
-
fn add_sdk(&mut self, sdk_info:
|
|
428
|
+
fn add_sdk(&mut self, sdk_info: Sdk) {
|
|
396
429
|
self.libs.extend(sdk_info.libs);
|
|
397
430
|
self.path.extend(sdk_info.path);
|
|
398
431
|
self.include.extend(sdk_info.include);
|
|
@@ -417,7 +450,7 @@ mod impl_ {
|
|
|
417
450
|
}
|
|
418
451
|
}
|
|
419
452
|
|
|
420
|
-
impl
|
|
453
|
+
impl Sdk {
|
|
421
454
|
fn find_tool(&self, tool: &str) -> Option<PathBuf> {
|
|
422
455
|
self.path.iter().map(|p| p.join(tool)).find_map(|mut p| {
|
|
423
456
|
(p.exists() || (p.set_extension(env::consts::EXE_SUFFIX) && p.exists()))
|
|
@@ -958,7 +991,7 @@ mod impl_ {
|
|
|
958
991
|
Some(tool.into_tool(env_getter))
|
|
959
992
|
}
|
|
960
993
|
|
|
961
|
-
fn get_sdks(target: TargetArch, env_getter: &dyn EnvGetter) -> Option<
|
|
994
|
+
pub(super) fn get_sdks(target: TargetArch, env_getter: &dyn EnvGetter) -> Option<Sdk> {
|
|
962
995
|
let sub = target.as_vs_arch();
|
|
963
996
|
let (ucrt, ucrt_version) = get_ucrt_dir()?;
|
|
964
997
|
|
|
@@ -969,7 +1002,7 @@ mod impl_ {
|
|
|
969
1002
|
_ => return None,
|
|
970
1003
|
};
|
|
971
1004
|
|
|
972
|
-
let mut info =
|
|
1005
|
+
let mut info = Sdk::default();
|
|
973
1006
|
|
|
974
1007
|
info.path
|
|
975
1008
|
.push(ucrt.join("bin").join(&ucrt_version).join(host));
|
|
@@ -989,6 +1022,7 @@ mod impl_ {
|
|
|
989
1022
|
info.include.push(sdk_include.join("cppwinrt"));
|
|
990
1023
|
info.include.push(sdk_include.join("winrt"));
|
|
991
1024
|
info.include.push(sdk_include.join("shared"));
|
|
1025
|
+
info.version = version;
|
|
992
1026
|
} else if let Some(sdk) = get_sdk81_dir() {
|
|
993
1027
|
info.path.push(sdk.join("bin").join(host));
|
|
994
1028
|
let sdk_lib = sdk.join("lib").join("winv6.3");
|
|
@@ -997,6 +1031,7 @@ mod impl_ {
|
|
|
997
1031
|
info.include.push(sdk_include.join("um"));
|
|
998
1032
|
info.include.push(sdk_include.join("winrt"));
|
|
999
1033
|
info.include.push(sdk_include.join("shared"));
|
|
1034
|
+
info.version = "8.1".into();
|
|
1000
1035
|
}
|
|
1001
1036
|
|
|
1002
1037
|
Some(info)
|
|
@@ -1018,12 +1053,7 @@ mod impl_ {
|
|
|
1018
1053
|
|
|
1019
1054
|
// Given a possible MSVC installation directory, we look for the linker and
|
|
1020
1055
|
// then add the MSVC library path.
|
|
1021
|
-
fn get_tool(
|
|
1022
|
-
tool: &str,
|
|
1023
|
-
path: &Path,
|
|
1024
|
-
target: TargetArch,
|
|
1025
|
-
sdk_info: &SdkInfo,
|
|
1026
|
-
) -> Option<MsvcTool> {
|
|
1056
|
+
fn get_tool(tool: &str, path: &Path, target: TargetArch, sdk_info: &Sdk) -> Option<MsvcTool> {
|
|
1027
1057
|
bin_subdir(target)
|
|
1028
1058
|
.into_iter()
|
|
1029
1059
|
.map(|(sub, host)| {
|
|
@@ -1477,7 +1507,7 @@ mod impl_ {
|
|
|
1477
1507
|
mod impl_ {
|
|
1478
1508
|
use std::{env, ffi::OsStr, path::PathBuf};
|
|
1479
1509
|
|
|
1480
|
-
use super::{EnvGetter, TargetArch};
|
|
1510
|
+
use super::{EnvGetter, Sdk, TargetArch};
|
|
1481
1511
|
use crate::Tool;
|
|
1482
1512
|
|
|
1483
1513
|
/// Finding msbuild.exe tool under unix system is not currently supported.
|
|
@@ -1568,4 +1598,9 @@ mod impl_ {
|
|
|
1568
1598
|
pub(super) fn get_ucrt_dir() -> Option<(PathBuf, String)> {
|
|
1569
1599
|
None
|
|
1570
1600
|
}
|
|
1601
|
+
|
|
1602
|
+
#[inline(always)]
|
|
1603
|
+
pub(super) fn get_sdks(_target: TargetArch, _env_getter: &dyn EnvGetter) -> Option<Sdk> {
|
|
1604
|
+
None
|
|
1605
|
+
}
|
|
1571
1606
|
}
|
|
@@ -17,7 +17,6 @@ use crate::converter::inline::link::append_markdown_link;
|
|
|
17
17
|
use crate::converter::main::walk_node;
|
|
18
18
|
use crate::converter::utility::content::{
|
|
19
19
|
collect_link_label_text, escape_link_label, get_text_content, normalize_link_label, normalized_tag_name,
|
|
20
|
-
truncate_at_char_boundary,
|
|
21
20
|
};
|
|
22
21
|
use crate::options::ConversionOptions;
|
|
23
22
|
use crate::text;
|
|
@@ -48,8 +47,6 @@ pub fn handle_link(
|
|
|
48
47
|
depth: usize,
|
|
49
48
|
dom_ctx: &DomContext,
|
|
50
49
|
) {
|
|
51
|
-
const MAX_LINK_LABEL_LEN: usize = 512;
|
|
52
|
-
|
|
53
50
|
let href_attr = tag
|
|
54
51
|
.attributes()
|
|
55
52
|
.get("href")
|
|
@@ -191,11 +188,6 @@ pub fn handle_link(
|
|
|
191
188
|
label = href.clone();
|
|
192
189
|
}
|
|
193
190
|
|
|
194
|
-
if label.len() > MAX_LINK_LABEL_LEN {
|
|
195
|
-
truncate_at_char_boundary(&mut label, MAX_LINK_LABEL_LEN);
|
|
196
|
-
label.push('…');
|
|
197
|
-
}
|
|
198
|
-
|
|
199
191
|
let escaped_label = escape_link_label(&label);
|
|
200
192
|
|
|
201
193
|
#[cfg(feature = "visitor")]
|
|
@@ -300,7 +292,7 @@ pub fn handle_link(
|
|
|
300
292
|
}
|
|
301
293
|
collector
|
|
302
294
|
.borrow_mut()
|
|
303
|
-
.add_link(href.clone(), label
|
|
295
|
+
.add_link(href.clone(), label, title.clone(), rel_attr, attributes_map);
|
|
304
296
|
}
|
|
305
297
|
}
|
|
306
298
|
} else {
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
//! - Autolinks for simple URLs like `<https://example.com>`
|
|
6
6
|
//! - Link label escaping for special Markdown characters
|
|
7
7
|
//! - Heading-in-link special handling (wraps link around heading)
|
|
8
|
-
//! - 512-character label truncation with ellipsis
|
|
9
8
|
//! - Visitor callbacks for custom link processing
|
|
10
9
|
//! - Metadata collection for links (links, URLs, titles, rel attributes)
|
|
11
10
|
//! - Block-level content within links (via inline context)
|
|
@@ -21,9 +20,6 @@ use tl::{NodeHandle, Parser};
|
|
|
21
20
|
type Context = crate::converter::Context;
|
|
22
21
|
type DomContext = crate::converter::DomContext;
|
|
23
22
|
|
|
24
|
-
/// Maximum length for link label before truncation
|
|
25
|
-
const MAX_LINK_LABEL_LEN: usize = 512;
|
|
26
|
-
|
|
27
23
|
/// Handler for anchor/link elements: `<a>`.
|
|
28
24
|
///
|
|
29
25
|
/// Processes anchor tags to generate Markdown links:
|
|
@@ -57,7 +53,7 @@ pub(crate) fn handle(
|
|
|
57
53
|
) {
|
|
58
54
|
// Import helper functions from parent converter module
|
|
59
55
|
use crate::converter::block::heading::{heading_allows_inline_images, push_heading};
|
|
60
|
-
use crate::converter::utility::content::
|
|
56
|
+
use crate::converter::utility::content::normalized_tag_name;
|
|
61
57
|
#[allow(unused_imports)]
|
|
62
58
|
use crate::converter::utility::serialization::serialize_node;
|
|
63
59
|
use crate::converter::{find_single_heading_child, get_text_content, walk_node};
|
|
@@ -227,11 +223,6 @@ pub(crate) fn handle(
|
|
|
227
223
|
}
|
|
228
224
|
|
|
229
225
|
// Truncate label if it exceeds maximum length
|
|
230
|
-
if label.len() > MAX_LINK_LABEL_LEN {
|
|
231
|
-
truncate_at_char_boundary(&mut label, MAX_LINK_LABEL_LEN);
|
|
232
|
-
label.push('…');
|
|
233
|
-
}
|
|
234
|
-
|
|
235
226
|
let escaped_label = escape_link_label(&label);
|
|
236
227
|
|
|
237
228
|
// Handle visitor callbacks if feature is enabled
|
|
@@ -338,7 +329,7 @@ pub(crate) fn handle(
|
|
|
338
329
|
}
|
|
339
330
|
collector
|
|
340
331
|
.borrow_mut()
|
|
341
|
-
.add_link(href.clone(), label
|
|
332
|
+
.add_link(href.clone(), label, title.clone(), rel_attr, attributes_map);
|
|
342
333
|
}
|
|
343
334
|
}
|
|
344
335
|
} else {
|
|
@@ -67,10 +67,20 @@ pub(crate) fn handle_dl(
|
|
|
67
67
|
};
|
|
68
68
|
crate::converter::walk_node(child_handle, parser, &mut content, options, &child_ctx, depth, dom_ctx);
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
match child_handle.get(parser) {
|
|
71
|
+
Some(tl::Node::Tag(_)) => {
|
|
72
|
+
if is_definition_term {
|
|
73
|
+
in_dt_group = true;
|
|
74
|
+
} else if !is_definition_description {
|
|
75
|
+
in_dt_group = false;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
Some(tl::Node::Raw(raw)) => {
|
|
79
|
+
if !raw.as_utf8_str().trim().is_empty() {
|
|
80
|
+
in_dt_group = false;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
Some(tl::Node::Comment(_)) | None => {}
|
|
74
84
|
}
|
|
75
85
|
}
|
|
76
86
|
}
|
|
@@ -156,9 +166,22 @@ pub(crate) fn handle_dd(
|
|
|
156
166
|
if trimmed.is_empty() {
|
|
157
167
|
output.push_str(": \n\n");
|
|
158
168
|
} else {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
169
|
+
let mut lines = trimmed.lines();
|
|
170
|
+
if let Some(first) = lines.next() {
|
|
171
|
+
output.push_str(": ");
|
|
172
|
+
output.push_str(first);
|
|
173
|
+
output.push('\n');
|
|
174
|
+
}
|
|
175
|
+
for line in lines {
|
|
176
|
+
if line.is_empty() {
|
|
177
|
+
output.push('\n');
|
|
178
|
+
} else {
|
|
179
|
+
output.push_str(" ");
|
|
180
|
+
output.push_str(line);
|
|
181
|
+
output.push('\n');
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
output.push('\n');
|
|
162
185
|
}
|
|
163
186
|
} else if !trimmed.is_empty() {
|
|
164
187
|
output.push_str(trimmed);
|
|
@@ -110,10 +110,20 @@ pub fn handle_dl(
|
|
|
110
110
|
walk_node(child_handle, parser, &mut content, options, &child_ctx, depth, dom_ctx);
|
|
111
111
|
|
|
112
112
|
// Update state for next iteration
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
113
|
+
match child_handle.get(parser) {
|
|
114
|
+
Some(tl::Node::Tag(_)) => {
|
|
115
|
+
if is_definition_term {
|
|
116
|
+
in_dt_group = true;
|
|
117
|
+
} else if !is_definition_description {
|
|
118
|
+
in_dt_group = false;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
Some(tl::Node::Raw(raw)) => {
|
|
122
|
+
if !raw.as_utf8_str().trim().is_empty() {
|
|
123
|
+
in_dt_group = false;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
Some(tl::Node::Comment(_)) | None => {}
|
|
117
127
|
}
|
|
118
128
|
}
|
|
119
129
|
}
|
|
@@ -220,9 +230,22 @@ pub fn handle_dd(
|
|
|
220
230
|
if trimmed.is_empty() {
|
|
221
231
|
output.push_str(": \n\n");
|
|
222
232
|
} else {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
233
|
+
let mut lines = trimmed.lines();
|
|
234
|
+
if let Some(first) = lines.next() {
|
|
235
|
+
output.push_str(": ");
|
|
236
|
+
output.push_str(first);
|
|
237
|
+
output.push('\n');
|
|
238
|
+
}
|
|
239
|
+
for line in lines {
|
|
240
|
+
if line.is_empty() {
|
|
241
|
+
output.push('\n');
|
|
242
|
+
} else {
|
|
243
|
+
output.push_str(" ");
|
|
244
|
+
output.push_str(line);
|
|
245
|
+
output.push('\n');
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
output.push('\n');
|
|
226
249
|
}
|
|
227
250
|
} else if !trimmed.is_empty() {
|
|
228
251
|
// Standalone definition (no preceding dt)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//! Regression coverage for issue #199.
|
|
2
|
+
|
|
3
|
+
use html_to_markdown_rs::convert;
|
|
4
|
+
|
|
5
|
+
#[test]
|
|
6
|
+
fn test_link_label_is_not_truncated() {
|
|
7
|
+
let label = "a".repeat(600);
|
|
8
|
+
let html = format!(r#"<a href="https://example.com">{}</a>"#, label);
|
|
9
|
+
|
|
10
|
+
let markdown = convert(&html, None).expect("conversion should succeed");
|
|
11
|
+
let expected = format!("[{}](https://example.com)", label);
|
|
12
|
+
|
|
13
|
+
assert!(markdown.contains(&expected));
|
|
14
|
+
assert!(!markdown.contains('…'));
|
|
15
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
//! Regression coverage for issue #200.
|
|
2
|
+
|
|
3
|
+
use html_to_markdown_rs::convert;
|
|
4
|
+
|
|
5
|
+
#[test]
|
|
6
|
+
fn test_definition_list_spacing_consistency() {
|
|
7
|
+
let html1 = r#"
|
|
8
|
+
<div>
|
|
9
|
+
<dl>
|
|
10
|
+
<dt>Tags:</dt>
|
|
11
|
+
<dd>
|
|
12
|
+
<ul>
|
|
13
|
+
<li>
|
|
14
|
+
<a href="https://site.com">php</a>
|
|
15
|
+
</li>
|
|
16
|
+
<li>
|
|
17
|
+
<a href="https://site.com/search/">closure</a>
|
|
18
|
+
</li>
|
|
19
|
+
</ul>
|
|
20
|
+
<button type="button">Add tags</button>
|
|
21
|
+
</dd>
|
|
22
|
+
</dl>
|
|
23
|
+
</div>
|
|
24
|
+
"#;
|
|
25
|
+
|
|
26
|
+
let html2 = r#"<div><dl><dt>Tags:</dt><dd><ul><li><a href="https://site.com">php</a></li><li><a href="https://site.com/search/">closure</a></li></ul><button type="button">Add tags</button></dd></dl></div>"#;
|
|
27
|
+
|
|
28
|
+
let markdown1 = convert(html1, None).expect("conversion should succeed");
|
|
29
|
+
let markdown2 = convert(html2, None).expect("conversion should succeed");
|
|
30
|
+
|
|
31
|
+
assert_eq!(markdown1, markdown2);
|
|
32
|
+
assert!(markdown1.contains("Tags:"));
|
|
33
|
+
assert!(markdown1.contains("\n: - [php]"));
|
|
34
|
+
assert!(markdown1.contains("\n - [closure]"));
|
|
35
|
+
assert!(markdown1.contains("\n Add tags"));
|
|
36
|
+
}
|