html-to-markdown 3.2.1 → 3.2.2
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 +2 -5
- data/ext/html_to_markdown_rb/src/lib.rs +28 -195
- data/lib/html_to_markdown/version.rb +1 -1
- data/vendor/Cargo.toml +1 -1
- data/vendor/html-to-markdown-rs/Cargo.toml +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f33e56e10217e7ff54fe3c267735521eeeec18d22865e2ddc6fb5d8209606801
|
|
4
|
+
data.tar.gz: 1d71cf3ad99071a53fc36a0d7faf25c909587a289dc035dd2e460441c6123ba2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5f75fd2e5f09b857d0dcf7ab64fd11dbf72637e5fd36c8eb30414f395daa0c9becbfaf052e0b45221e9a9e34cdca2854160b4233ebf4b4bed161f8097b5c793b
|
|
7
|
+
data.tar.gz: 2fa6b149e3570eeb8fa8d79ea3af1dbb850ea83071fc130fd269d98bbff63106598385638e3f89fbae3f49625368b35454de3eafa31a15ddd3ab56fb3eff4b27
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
html-to-markdown (3.2.
|
|
4
|
+
html-to-markdown (3.2.2)
|
|
5
5
|
rb_sys (>= 0.9, < 1.0)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
@@ -12,7 +12,6 @@ GEM
|
|
|
12
12
|
csv (3.3.5)
|
|
13
13
|
diff-lcs (1.6.2)
|
|
14
14
|
ffi (1.17.4-arm64-darwin)
|
|
15
|
-
ffi (1.17.4-x86_64-linux-gnu)
|
|
16
15
|
fileutils (1.8.0)
|
|
17
16
|
json (2.19.3)
|
|
18
17
|
language_server-protocol (3.17.0.5)
|
|
@@ -107,7 +106,6 @@ GEM
|
|
|
107
106
|
|
|
108
107
|
PLATFORMS
|
|
109
108
|
arm64-darwin
|
|
110
|
-
x86_64-linux
|
|
111
109
|
|
|
112
110
|
DEPENDENCIES
|
|
113
111
|
html-to-markdown!
|
|
@@ -126,9 +124,8 @@ CHECKSUMS
|
|
|
126
124
|
csv (3.3.5) sha256=6e5134ac3383ef728b7f02725d9872934f523cb40b961479f69cf3afa6c8e73f
|
|
127
125
|
diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
|
|
128
126
|
ffi (1.17.4-arm64-darwin) sha256=19071aaf1419251b0a46852abf960e77330a3b334d13a4ab51d58b31a937001b
|
|
129
|
-
ffi (1.17.4-x86_64-linux-gnu) sha256=9d3db14c2eae074b382fa9c083fe95aec6e0a1451da249eab096c34002bc752d
|
|
130
127
|
fileutils (1.8.0) sha256=8c6b1df54e2540bdb2f39258f08af78853aa70bad52b4d394bbc6424593c6e02
|
|
131
|
-
html-to-markdown (3.2.
|
|
128
|
+
html-to-markdown (3.2.2)
|
|
132
129
|
json (2.19.3) sha256=289b0bb53052a1fa8c34ab33cc750b659ba14a5c45f3fcf4b18762dc67c78646
|
|
133
130
|
language_server-protocol (3.17.0.5) sha256=fd1e39a51a28bf3eec959379985a72e296e9f9acfce46f6a79d31ca8760803cc
|
|
134
131
|
lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
|
|
@@ -40,9 +40,8 @@ fn json_to_ruby(handle: &Ruby, val: serde_json::Value) -> magnus::Value {
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
#[derive(Clone, Debug
|
|
43
|
+
#[derive(Clone, Debug)]
|
|
44
44
|
#[magnus::wrap(class = "HtmlToMarkdownRs::MetadataConfig")]
|
|
45
|
-
#[serde(default)]
|
|
46
45
|
pub struct MetadataConfig {
|
|
47
46
|
pub extract_document: bool,
|
|
48
47
|
pub extract_headers: bool,
|
|
@@ -131,9 +130,8 @@ impl MetadataConfig {
|
|
|
131
130
|
}
|
|
132
131
|
}
|
|
133
132
|
|
|
134
|
-
#[derive(Clone, Debug
|
|
133
|
+
#[derive(Clone, Debug)]
|
|
135
134
|
#[magnus::wrap(class = "HtmlToMarkdownRs::MetadataConfigUpdate")]
|
|
136
|
-
#[serde(default)]
|
|
137
135
|
pub struct MetadataConfigUpdate {
|
|
138
136
|
pub extract_document: Option<bool>,
|
|
139
137
|
pub extract_headers: Option<bool>,
|
|
@@ -210,9 +208,8 @@ impl MetadataConfigUpdate {
|
|
|
210
208
|
}
|
|
211
209
|
}
|
|
212
210
|
|
|
213
|
-
#[derive(Clone, Debug,
|
|
211
|
+
#[derive(Clone, Debug, Default)]
|
|
214
212
|
#[magnus::wrap(class = "HtmlToMarkdownRs::DocumentMetadata")]
|
|
215
|
-
#[serde(default)]
|
|
216
213
|
pub struct DocumentMetadata {
|
|
217
214
|
pub title: Option<String>,
|
|
218
215
|
pub description: Option<String>,
|
|
@@ -237,24 +234,6 @@ impl magnus::TryConvert for DocumentMetadata {
|
|
|
237
234
|
}
|
|
238
235
|
unsafe impl TryConvertOwned for DocumentMetadata {}
|
|
239
236
|
|
|
240
|
-
impl Default for DocumentMetadata {
|
|
241
|
-
fn default() -> Self {
|
|
242
|
-
Self {
|
|
243
|
-
title: Default::default(),
|
|
244
|
-
description: Default::default(),
|
|
245
|
-
keywords: Default::default(),
|
|
246
|
-
author: Default::default(),
|
|
247
|
-
canonical_url: Default::default(),
|
|
248
|
-
base_href: Default::default(),
|
|
249
|
-
language: Default::default(),
|
|
250
|
-
text_direction: Default::default(),
|
|
251
|
-
open_graph: Default::default(),
|
|
252
|
-
twitter_card: Default::default(),
|
|
253
|
-
meta_tags: Default::default(),
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
|
|
258
237
|
impl DocumentMetadata {
|
|
259
238
|
fn new(
|
|
260
239
|
title: Option<String>,
|
|
@@ -329,7 +308,7 @@ impl DocumentMetadata {
|
|
|
329
308
|
}
|
|
330
309
|
}
|
|
331
310
|
|
|
332
|
-
#[derive(Clone, Debug
|
|
311
|
+
#[derive(Clone, Debug)]
|
|
333
312
|
#[magnus::wrap(class = "HtmlToMarkdownRs::HeaderMetadata")]
|
|
334
313
|
pub struct HeaderMetadata {
|
|
335
314
|
pub level: u8,
|
|
@@ -392,7 +371,7 @@ impl HeaderMetadata {
|
|
|
392
371
|
}
|
|
393
372
|
}
|
|
394
373
|
|
|
395
|
-
#[derive(Clone, Debug
|
|
374
|
+
#[derive(Clone, Debug)]
|
|
396
375
|
#[magnus::wrap(class = "HtmlToMarkdownRs::LinkMetadata")]
|
|
397
376
|
pub struct LinkMetadata {
|
|
398
377
|
pub href: String,
|
|
@@ -457,7 +436,7 @@ impl LinkMetadata {
|
|
|
457
436
|
}
|
|
458
437
|
}
|
|
459
438
|
|
|
460
|
-
#[derive(Clone, Debug
|
|
439
|
+
#[derive(Clone, Debug)]
|
|
461
440
|
#[magnus::wrap(class = "HtmlToMarkdownRs::ImageMetadata")]
|
|
462
441
|
pub struct ImageMetadata {
|
|
463
442
|
pub src: String,
|
|
@@ -522,7 +501,7 @@ impl ImageMetadata {
|
|
|
522
501
|
}
|
|
523
502
|
}
|
|
524
503
|
|
|
525
|
-
#[derive(Clone, Debug
|
|
504
|
+
#[derive(Clone, Debug)]
|
|
526
505
|
#[magnus::wrap(class = "HtmlToMarkdownRs::StructuredData")]
|
|
527
506
|
pub struct StructuredData {
|
|
528
507
|
pub data_type: StructuredDataType,
|
|
@@ -562,9 +541,8 @@ impl StructuredData {
|
|
|
562
541
|
}
|
|
563
542
|
}
|
|
564
543
|
|
|
565
|
-
#[derive(Clone, Debug,
|
|
544
|
+
#[derive(Clone, Debug, Default)]
|
|
566
545
|
#[magnus::wrap(class = "HtmlToMarkdownRs::HtmlMetadata")]
|
|
567
|
-
#[serde(default)]
|
|
568
546
|
pub struct HtmlMetadata {
|
|
569
547
|
pub document: DocumentMetadata,
|
|
570
548
|
pub headers: Vec<HeaderMetadata>,
|
|
@@ -583,18 +561,6 @@ impl magnus::TryConvert for HtmlMetadata {
|
|
|
583
561
|
}
|
|
584
562
|
unsafe impl TryConvertOwned for HtmlMetadata {}
|
|
585
563
|
|
|
586
|
-
impl Default for HtmlMetadata {
|
|
587
|
-
fn default() -> Self {
|
|
588
|
-
Self {
|
|
589
|
-
document: Default::default(),
|
|
590
|
-
headers: Default::default(),
|
|
591
|
-
links: Default::default(),
|
|
592
|
-
images: Default::default(),
|
|
593
|
-
structured_data: Default::default(),
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
|
|
598
564
|
impl HtmlMetadata {
|
|
599
565
|
fn new(
|
|
600
566
|
document: Option<DocumentMetadata>,
|
|
@@ -633,9 +599,8 @@ impl HtmlMetadata {
|
|
|
633
599
|
}
|
|
634
600
|
}
|
|
635
601
|
|
|
636
|
-
#[derive(Clone, Debug,
|
|
602
|
+
#[derive(Clone, Debug, Default)]
|
|
637
603
|
#[magnus::wrap(class = "HtmlToMarkdownRs::ConversionOptions")]
|
|
638
|
-
#[serde(default)]
|
|
639
604
|
pub struct ConversionOptions {
|
|
640
605
|
pub heading_style: HeadingStyle,
|
|
641
606
|
pub list_indent_type: ListIndentType,
|
|
@@ -687,51 +652,6 @@ impl magnus::TryConvert for ConversionOptions {
|
|
|
687
652
|
}
|
|
688
653
|
unsafe impl TryConvertOwned for ConversionOptions {}
|
|
689
654
|
|
|
690
|
-
impl Default for ConversionOptions {
|
|
691
|
-
fn default() -> Self {
|
|
692
|
-
Self {
|
|
693
|
-
heading_style: Default::default(),
|
|
694
|
-
list_indent_type: Default::default(),
|
|
695
|
-
list_indent_width: Default::default(),
|
|
696
|
-
bullets: Default::default(),
|
|
697
|
-
strong_em_symbol: Default::default(),
|
|
698
|
-
escape_asterisks: Default::default(),
|
|
699
|
-
escape_underscores: Default::default(),
|
|
700
|
-
escape_misc: Default::default(),
|
|
701
|
-
escape_ascii: Default::default(),
|
|
702
|
-
code_language: Default::default(),
|
|
703
|
-
autolinks: Default::default(),
|
|
704
|
-
default_title: Default::default(),
|
|
705
|
-
br_in_tables: Default::default(),
|
|
706
|
-
highlight_style: Default::default(),
|
|
707
|
-
extract_metadata: Default::default(),
|
|
708
|
-
whitespace_mode: Default::default(),
|
|
709
|
-
strip_newlines: Default::default(),
|
|
710
|
-
wrap: Default::default(),
|
|
711
|
-
wrap_width: Default::default(),
|
|
712
|
-
convert_as_inline: Default::default(),
|
|
713
|
-
sub_symbol: Default::default(),
|
|
714
|
-
sup_symbol: Default::default(),
|
|
715
|
-
newline_style: Default::default(),
|
|
716
|
-
code_block_style: Default::default(),
|
|
717
|
-
keep_inline_images_in: Default::default(),
|
|
718
|
-
preprocessing: Default::default(),
|
|
719
|
-
encoding: Default::default(),
|
|
720
|
-
debug: Default::default(),
|
|
721
|
-
strip_tags: Default::default(),
|
|
722
|
-
preserve_tags: Default::default(),
|
|
723
|
-
skip_images: Default::default(),
|
|
724
|
-
link_style: Default::default(),
|
|
725
|
-
output_format: Default::default(),
|
|
726
|
-
include_document_structure: Default::default(),
|
|
727
|
-
extract_images: Default::default(),
|
|
728
|
-
max_image_size: Default::default(),
|
|
729
|
-
capture_svg: Default::default(),
|
|
730
|
-
infer_dimensions: Default::default(),
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
}
|
|
734
|
-
|
|
735
655
|
impl ConversionOptions {
|
|
736
656
|
fn new(kwargs: magnus::RHash) -> Result<Self, magnus::Error> {
|
|
737
657
|
let ruby = unsafe { magnus::Ruby::get_unchecked() };
|
|
@@ -1090,9 +1010,8 @@ impl ConversionOptionsBuilder {
|
|
|
1090
1010
|
}
|
|
1091
1011
|
}
|
|
1092
1012
|
|
|
1093
|
-
#[derive(Clone, Debug,
|
|
1013
|
+
#[derive(Clone, Debug, Default)]
|
|
1094
1014
|
#[magnus::wrap(class = "HtmlToMarkdownRs::ConversionOptionsUpdate")]
|
|
1095
|
-
#[serde(default)]
|
|
1096
1015
|
pub struct ConversionOptionsUpdate {
|
|
1097
1016
|
pub heading_style: Option<HeadingStyle>,
|
|
1098
1017
|
pub list_indent_type: Option<ListIndentType>,
|
|
@@ -1144,51 +1063,6 @@ impl magnus::TryConvert for ConversionOptionsUpdate {
|
|
|
1144
1063
|
}
|
|
1145
1064
|
unsafe impl TryConvertOwned for ConversionOptionsUpdate {}
|
|
1146
1065
|
|
|
1147
|
-
impl Default for ConversionOptionsUpdate {
|
|
1148
|
-
fn default() -> Self {
|
|
1149
|
-
Self {
|
|
1150
|
-
heading_style: Default::default(),
|
|
1151
|
-
list_indent_type: Default::default(),
|
|
1152
|
-
list_indent_width: Default::default(),
|
|
1153
|
-
bullets: Default::default(),
|
|
1154
|
-
strong_em_symbol: Default::default(),
|
|
1155
|
-
escape_asterisks: Default::default(),
|
|
1156
|
-
escape_underscores: Default::default(),
|
|
1157
|
-
escape_misc: Default::default(),
|
|
1158
|
-
escape_ascii: Default::default(),
|
|
1159
|
-
code_language: Default::default(),
|
|
1160
|
-
autolinks: Default::default(),
|
|
1161
|
-
default_title: Default::default(),
|
|
1162
|
-
br_in_tables: Default::default(),
|
|
1163
|
-
highlight_style: Default::default(),
|
|
1164
|
-
extract_metadata: Default::default(),
|
|
1165
|
-
whitespace_mode: Default::default(),
|
|
1166
|
-
strip_newlines: Default::default(),
|
|
1167
|
-
wrap: Default::default(),
|
|
1168
|
-
wrap_width: Default::default(),
|
|
1169
|
-
convert_as_inline: Default::default(),
|
|
1170
|
-
sub_symbol: Default::default(),
|
|
1171
|
-
sup_symbol: Default::default(),
|
|
1172
|
-
newline_style: Default::default(),
|
|
1173
|
-
code_block_style: Default::default(),
|
|
1174
|
-
keep_inline_images_in: Default::default(),
|
|
1175
|
-
preprocessing: Default::default(),
|
|
1176
|
-
encoding: Default::default(),
|
|
1177
|
-
debug: Default::default(),
|
|
1178
|
-
strip_tags: Default::default(),
|
|
1179
|
-
preserve_tags: Default::default(),
|
|
1180
|
-
skip_images: Default::default(),
|
|
1181
|
-
link_style: Default::default(),
|
|
1182
|
-
output_format: Default::default(),
|
|
1183
|
-
include_document_structure: Default::default(),
|
|
1184
|
-
extract_images: Default::default(),
|
|
1185
|
-
max_image_size: Default::default(),
|
|
1186
|
-
capture_svg: Default::default(),
|
|
1187
|
-
infer_dimensions: Default::default(),
|
|
1188
|
-
}
|
|
1189
|
-
}
|
|
1190
|
-
}
|
|
1191
|
-
|
|
1192
1066
|
impl ConversionOptionsUpdate {
|
|
1193
1067
|
fn new(kwargs: magnus::RHash) -> Result<Self, magnus::Error> {
|
|
1194
1068
|
let ruby = unsafe { magnus::Ruby::get_unchecked() };
|
|
@@ -1463,9 +1337,8 @@ impl ConversionOptionsUpdate {
|
|
|
1463
1337
|
}
|
|
1464
1338
|
}
|
|
1465
1339
|
|
|
1466
|
-
#[derive(Clone, Debug,
|
|
1340
|
+
#[derive(Clone, Debug, Default)]
|
|
1467
1341
|
#[magnus::wrap(class = "HtmlToMarkdownRs::PreprocessingOptions")]
|
|
1468
|
-
#[serde(default)]
|
|
1469
1342
|
pub struct PreprocessingOptions {
|
|
1470
1343
|
pub enabled: bool,
|
|
1471
1344
|
pub preset: PreprocessingPreset,
|
|
@@ -1483,17 +1356,6 @@ impl magnus::TryConvert for PreprocessingOptions {
|
|
|
1483
1356
|
}
|
|
1484
1357
|
unsafe impl TryConvertOwned for PreprocessingOptions {}
|
|
1485
1358
|
|
|
1486
|
-
impl Default for PreprocessingOptions {
|
|
1487
|
-
fn default() -> Self {
|
|
1488
|
-
Self {
|
|
1489
|
-
enabled: Default::default(),
|
|
1490
|
-
preset: Default::default(),
|
|
1491
|
-
remove_navigation: Default::default(),
|
|
1492
|
-
remove_forms: Default::default(),
|
|
1493
|
-
}
|
|
1494
|
-
}
|
|
1495
|
-
}
|
|
1496
|
-
|
|
1497
1359
|
impl PreprocessingOptions {
|
|
1498
1360
|
fn new(
|
|
1499
1361
|
enabled: Option<bool>,
|
|
@@ -1526,9 +1388,8 @@ impl PreprocessingOptions {
|
|
|
1526
1388
|
}
|
|
1527
1389
|
}
|
|
1528
1390
|
|
|
1529
|
-
#[derive(Clone, Debug,
|
|
1391
|
+
#[derive(Clone, Debug, Default)]
|
|
1530
1392
|
#[magnus::wrap(class = "HtmlToMarkdownRs::PreprocessingOptionsUpdate")]
|
|
1531
|
-
#[serde(default)]
|
|
1532
1393
|
pub struct PreprocessingOptionsUpdate {
|
|
1533
1394
|
pub enabled: Option<bool>,
|
|
1534
1395
|
pub preset: Option<PreprocessingPreset>,
|
|
@@ -1546,17 +1407,6 @@ impl magnus::TryConvert for PreprocessingOptionsUpdate {
|
|
|
1546
1407
|
}
|
|
1547
1408
|
unsafe impl TryConvertOwned for PreprocessingOptionsUpdate {}
|
|
1548
1409
|
|
|
1549
|
-
impl Default for PreprocessingOptionsUpdate {
|
|
1550
|
-
fn default() -> Self {
|
|
1551
|
-
Self {
|
|
1552
|
-
enabled: Default::default(),
|
|
1553
|
-
preset: Default::default(),
|
|
1554
|
-
remove_navigation: Default::default(),
|
|
1555
|
-
remove_forms: Default::default(),
|
|
1556
|
-
}
|
|
1557
|
-
}
|
|
1558
|
-
}
|
|
1559
|
-
|
|
1560
1410
|
impl PreprocessingOptionsUpdate {
|
|
1561
1411
|
fn new(
|
|
1562
1412
|
enabled: Option<bool>,
|
|
@@ -1721,9 +1571,8 @@ impl TextAnnotation {
|
|
|
1721
1571
|
}
|
|
1722
1572
|
}
|
|
1723
1573
|
|
|
1724
|
-
#[derive(Clone, Debug,
|
|
1574
|
+
#[derive(Clone, Debug, Default)]
|
|
1725
1575
|
#[magnus::wrap(class = "HtmlToMarkdownRs::ConversionResult")]
|
|
1726
|
-
#[serde(default)]
|
|
1727
1576
|
pub struct ConversionResult {
|
|
1728
1577
|
pub content: Option<String>,
|
|
1729
1578
|
pub document: Option<DocumentStructure>,
|
|
@@ -1743,19 +1592,6 @@ impl magnus::TryConvert for ConversionResult {
|
|
|
1743
1592
|
}
|
|
1744
1593
|
unsafe impl TryConvertOwned for ConversionResult {}
|
|
1745
1594
|
|
|
1746
|
-
impl Default for ConversionResult {
|
|
1747
|
-
fn default() -> Self {
|
|
1748
|
-
Self {
|
|
1749
|
-
content: Default::default(),
|
|
1750
|
-
document: Default::default(),
|
|
1751
|
-
metadata: Default::default(),
|
|
1752
|
-
tables: Default::default(),
|
|
1753
|
-
images: Default::default(),
|
|
1754
|
-
warnings: Default::default(),
|
|
1755
|
-
}
|
|
1756
|
-
}
|
|
1757
|
-
}
|
|
1758
|
-
|
|
1759
1595
|
impl ConversionResult {
|
|
1760
1596
|
fn new(
|
|
1761
1597
|
content: Option<String>,
|
|
@@ -1800,7 +1636,7 @@ impl ConversionResult {
|
|
|
1800
1636
|
}
|
|
1801
1637
|
}
|
|
1802
1638
|
|
|
1803
|
-
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
|
1639
|
+
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize, Default)]
|
|
1804
1640
|
#[magnus::wrap(class = "HtmlToMarkdownRs::TableGrid")]
|
|
1805
1641
|
#[serde(default)]
|
|
1806
1642
|
pub struct TableGrid {
|
|
@@ -1819,16 +1655,6 @@ impl magnus::TryConvert for TableGrid {
|
|
|
1819
1655
|
}
|
|
1820
1656
|
unsafe impl TryConvertOwned for TableGrid {}
|
|
1821
1657
|
|
|
1822
|
-
impl Default for TableGrid {
|
|
1823
|
-
fn default() -> Self {
|
|
1824
|
-
Self {
|
|
1825
|
-
rows: Default::default(),
|
|
1826
|
-
cols: Default::default(),
|
|
1827
|
-
cells: Default::default(),
|
|
1828
|
-
}
|
|
1829
|
-
}
|
|
1830
|
-
}
|
|
1831
|
-
|
|
1832
1658
|
impl TableGrid {
|
|
1833
1659
|
fn new(rows: Option<u32>, cols: Option<u32>, cells: Option<Vec<GridCell>>) -> Self {
|
|
1834
1660
|
Self {
|
|
@@ -2594,7 +2420,8 @@ impl magnus::IntoValue for NodeContent {
|
|
|
2594
2420
|
impl magnus::TryConvert for NodeContent {
|
|
2595
2421
|
fn try_convert(val: magnus::Value) -> Result<Self, magnus::Error> {
|
|
2596
2422
|
let s: String = magnus::TryConvert::try_convert(val)?;
|
|
2597
|
-
serde_json::from_str(&s)
|
|
2423
|
+
serde_json::from_str(&s)
|
|
2424
|
+
.map_err(|e| magnus::Error::new(unsafe { Ruby::get_unchecked() }.exception_type_error(), e.to_string()))
|
|
2598
2425
|
}
|
|
2599
2426
|
}
|
|
2600
2427
|
|
|
@@ -2633,7 +2460,8 @@ impl magnus::IntoValue for AnnotationKind {
|
|
|
2633
2460
|
impl magnus::TryConvert for AnnotationKind {
|
|
2634
2461
|
fn try_convert(val: magnus::Value) -> Result<Self, magnus::Error> {
|
|
2635
2462
|
let s: String = magnus::TryConvert::try_convert(val)?;
|
|
2636
|
-
serde_json::from_str(&s)
|
|
2463
|
+
serde_json::from_str(&s)
|
|
2464
|
+
.map_err(|e| magnus::Error::new(unsafe { Ruby::get_unchecked() }.exception_type_error(), e.to_string()))
|
|
2637
2465
|
}
|
|
2638
2466
|
}
|
|
2639
2467
|
|
|
@@ -2693,13 +2521,18 @@ fn convert(html: String, options: Option<String>) -> Result<ConversionResult, Er
|
|
|
2693
2521
|
.as_deref()
|
|
2694
2522
|
.filter(|s| *s != "nil")
|
|
2695
2523
|
.map(|s| {
|
|
2696
|
-
let core: html_to_markdown_rs::ConversionOptions = serde_json::from_str(s)
|
|
2697
|
-
|
|
2524
|
+
let core: html_to_markdown_rs::ConversionOptions = serde_json::from_str(s).map_err(|e| {
|
|
2525
|
+
magnus::Error::new(unsafe { Ruby::get_unchecked() }.exception_type_error(), e.to_string())
|
|
2526
|
+
})?;
|
|
2698
2527
|
Ok::<_, magnus::Error>(core.into())
|
|
2699
2528
|
})
|
|
2700
2529
|
.transpose()?;
|
|
2701
|
-
let result = html_to_markdown_rs::convert(&html, options.map(Into::into))
|
|
2702
|
-
|
|
2530
|
+
let result = html_to_markdown_rs::convert(&html, options.map(Into::into)).map_err(|e| {
|
|
2531
|
+
magnus::Error::new(
|
|
2532
|
+
unsafe { Ruby::get_unchecked() }.exception_runtime_error(),
|
|
2533
|
+
e.to_string(),
|
|
2534
|
+
)
|
|
2535
|
+
})?;
|
|
2703
2536
|
Ok(result.into())
|
|
2704
2537
|
}
|
|
2705
2538
|
|
|
@@ -3640,7 +3473,7 @@ impl From<html_to_markdown_rs::WarningKind> for WarningKind {
|
|
|
3640
3473
|
#[allow(dead_code)]
|
|
3641
3474
|
fn conversion_error_to_magnus_err(e: html_to_markdown_rs::error::ConversionError) -> magnus::Error {
|
|
3642
3475
|
let msg = e.to_string();
|
|
3643
|
-
magnus::Error::new(magnus::
|
|
3476
|
+
magnus::Error::new(unsafe { magnus::Ruby::get_unchecked() }.exception_runtime_error(), msg)
|
|
3644
3477
|
}
|
|
3645
3478
|
|
|
3646
3479
|
#[magnus::init]
|
data/vendor/Cargo.toml
CHANGED