Skip to content
This repository was archived by the owner on Jul 26, 2025. It is now read-only.

Commit d6e538f

Browse files
committed
Parse content types when MetaData nodes are in the html
1 parent b63b5ce commit d6e538f

9 files changed

Lines changed: 1860 additions & 243 deletions

File tree

transformer/src/parsers/doc/detail_page.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ impl<'a> TryFrom<&scraper::ElementRef<'a>> for DefinitionListValue {
5959
type Error = DefinitionListValueFromElError;
6060

6161
fn try_from(el: &scraper::ElementRef) -> Result<Self, Self::Error> {
62-
let top_selector = scraper::Selector::parse(":scope > dl, :scope > a")
62+
let top_selector = scraper::Selector::parse(":scope > dl, :scope > MetadataType > dl")
6363
.map_err(|e| Self::Error::SelectorParseError(format!("{:?}", e)))?;
6464
let child = el.select(&top_selector).next();
6565
match (child, child.map(|c| c.value().name())) {

transformer/src/parsers/doc/etc/object_type.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -468,16 +468,16 @@ fn removed_field_test() {
468468
assert_eq!(
469469
serde_json::to_value(value).unwrap(),
470470
json!({
471-
"title": "test_BaseType",
472-
"description": "A base abstract type for all the types.",
473-
"type": "object",
474-
"properties": {
475-
"fieldB": {
476-
"description": "A field that has not been removed",
477-
"type": "string"
478-
}
479-
},
480-
"additionalProperties": false
481-
})
471+
"title": "test_BaseType",
472+
"description": "A base abstract type for all the types.",
473+
"type": "object",
474+
"properties": {
475+
"fieldB": {
476+
"description": "A field that has not been removed",
477+
"type": "string"
478+
}
479+
},
480+
"additionalProperties": false
481+
})
482482
);
483483
}

0 commit comments

Comments
 (0)