Skip to content

Commit da77365

Browse files
committed
Register-docs: Don't duplicate brief in description
1 parent ac8b1da commit da77365

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

godot-core/src/docs.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,12 @@ pub fn gather_xml_docs() -> impl Iterator<Item = String> {
112112
.then(String::new)
113113
.unwrap_or_else(|| format!("<methods>{methods}{virtual_methods}</methods>"));
114114

115-
let brief = description
116-
.split_once("[br]")
117-
.map(|(x, _)| x)
118-
.unwrap_or_default();
115+
let (brief, mut description) = match description
116+
.split_once("[br]") {
117+
Some((brief, description)) => (brief, description),
118+
None => (description, ""),
119+
};
120+
description = description.trim_start_matches("[br]");
119121

120122
format!(r#"<?xml version="1.0" encoding="UTF-8"?>
121123
<class name="{class}" inherits="{base}" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">

0 commit comments

Comments
 (0)