From 19398e340cd21c13e36fa08bfa001e79673a506a Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Sun, 26 Jul 2020 11:04:13 +0200 Subject: [PATCH] Remove spurious members from module documentation With this patch, we require that the identifier element for a member in the module documentation is a direct child of the table cell. This fixes problems with spurious member elements if there are more elements in the table cell, e. g. stability annotations. --- CHANGELOG.md | 1 + src/parser.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1dc8217..948fae2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ SPDX-License-Identifier: MIT instead of always using `/usr`. - Improve the documentation parser: - Fix the definition of methods to only contain the actual definition. + - Remove spurious members in module documentation. ## v0.1.2 (2020-07-25) diff --git a/src/parser.rs b/src/parser.rs index dba1451..cf2af5d 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -493,7 +493,7 @@ fn get_members( ) -> anyhow::Result> { let mut members: Vec = Vec::new(); if let Some(table) = select_first(document, &format!("#{} + table", ty.group_id()))? { - let items = select(table.as_node(), "td:first-child :first-child")?; + let items = select(table.as_node(), "td:first-child > :first-child")?; for item in items { let item_name = item.as_node().text_contents(); let docblock = item.as_node().parent().and_then(|n| n.next_sibling());