Skip to content

jsdoc rendering summary can end with a : #633

Description

@crowlKats

In some cases, a JSDoc summary can end with a :. We should change this by backtracking to a . if one is present and only show the content until then, else still show the summary as-is.

The relevant part of the codebase is

deno_doc/src/html/jsdoc.rs

Lines 392 to 418 in 93f4ce3

fn walk_node_title<'a>(node: &'a AstNode<'a>) {
for child in node.children() {
if matches!(
child.data.borrow().value,
NodeValue::Document
| NodeValue::Paragraph
| NodeValue::Heading(_)
| NodeValue::Text(_)
| NodeValue::Code(_)
| NodeValue::HtmlInline(_)
| NodeValue::Emph
| NodeValue::Strong
| NodeValue::Strikethrough
| NodeValue::Superscript
| NodeValue::Link(_)
| NodeValue::Math(_)
| NodeValue::Escaped
| NodeValue::WikiLink(_)
| NodeValue::Underline
) {
walk_node_title(child);
} else {
// delete the node
child.detach();
}
}
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions