From ae0a741d5a5608c7dc8a0d6bec387392ddb3d52f Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Sun, 26 Jul 2020 12:12:50 +0200 Subject: [PATCH] Extract description of module items as HTML Previously, we only showed plain text versions of the item descriptions in the module overview due to a formatting issue. As this issue disappeared, we can now use the HTML version of the description. --- CHANGELOG.md | 1 + src/parser.rs | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9beb0da..ea1da31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ SPDX-License-Identifier: MIT - Remove spurious members in module documentation. - Show the definition for constants and typedefs. - Fix group and ID for typdef items. + - Extract the description of module items as HTML instead of plain text. ## v0.1.2 (2020-07-25) diff --git a/src/parser.rs b/src/parser.rs index 7e8ee03..1acf784 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -500,9 +500,7 @@ fn get_members( let docblock = item.as_node().parent().and_then(|n| n.next_sibling()); let mut doc = doc::Doc::new(parent.name.child(&item_name), ty); - // We would like to use inner_html() here, but that is currently not implemented in - // kuchiki - doc.description = docblock.map(|n| n.text_contents()); + doc.description = docblock.map(|n| get_html(&n)).transpose()?; members.push(doc); } }