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

Fix NoSuchElementException in scaladoc #18184

Merged
merged 2 commits into from
Jul 13, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ object SectionRenderingExtension extends HtmlRenderer.HtmlRendererExtension:
val Section(header, body) = node
val idSuffix = repeatedIds.getOrElseUpdate((c, header.getText), 0)
val ifSuffixStr = if(idSuffix == 0) then "" else idSuffix.toString
repeatedIds.update((c, header.getText), repeatedIds((c, header.getText)) + 1)
repeatedIds.update((c, header.getText), idSuffix + 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Those the result of header.getText have a stable hash?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it should, but just to be extra safe I extracted that in the next commit

val id = idGenerator.getId(header.getText.append(ifSuffixStr))
val anchor = AnchorLink(s"#$id")
val headerClass: String = header.getLevel match
Expand Down
Loading