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

too_long_first_doc_paragraph considers rendered output link #13363

Conversation

alex-semenyuk
Copy link
Member

Close #13315
As mentioned at #13315 the raw markdown for the link foo contains 13 bytes, but the rendered output is only 3 bytes. This leads to warnings about short paragraphs with long links.

changelog: [too_long_first_doc_paragraph]: considers rendered output link

@rustbot
Copy link
Collaborator

rustbot commented Sep 7, 2024

r? @Alexendoo

rustbot has assigned @Alexendoo.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Sep 7, 2024
@alex-semenyuk alex-semenyuk marked this pull request as draft September 7, 2024 10:09
@alex-semenyuk alex-semenyuk marked this pull request as ready for review September 7, 2024 10:26
Comment on lines +849 to +851
let paragraph_string: String = doc[paragraph_range.clone()].chars().collect();
let markdown_without_links = replace_markdown_links(&paragraph_string);
headers.first_paragraph_len = markdown_without_links.len();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're in the context of a markdown parser we should aim to use that rather than ad hoc processing, possibly by moving the first_paragraph_len part into the Text event as a +=

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

too_long_first_doc_paragraph only considers markdown source not the rendered output
3 participants