Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jsdoc rendering summary can end with a : #633

Open
crowlKats opened this issue Sep 25, 2024 · 2 comments
Open

jsdoc rendering summary can end with a : #633

crowlKats opened this issue Sep 25, 2024 · 2 comments
Labels
feature A new feature good first issue Good for newcomers html

Comments

@crowlKats
Copy link
Member

crowlKats commented Sep 25, 2024

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();
}
}
}

@crowlKats crowlKats added feature A new feature html good first issue Good for newcomers labels Sep 25, 2024
@c43721
Copy link

c43721 commented Nov 7, 2024

I'd be interested in working on this but could you help provide an example of what the output is currently and what it should look like? Thanks!

@crowlKats
Copy link
Member Author

@c43721 sure. for example:
https://docs.deno.com/api/node/child_process/~/exec

The summary currently renders like this:
Screenshot 2024-11-21 at 16 15 25
However since it ends with :, it should backtrack, so it should end up being this
Screenshot 2024-11-21 at 16 15 50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature good first issue Good for newcomers html
Projects
None yet
Development

No branches or pull requests

2 participants