We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
HeaderIdGenerator
synchronized
2 parents 26fb24a + b48eee3 commit 1c11610Copy full SHA for 1c11610
scaladoc/src/dotty/tools/scaladoc/tasty/comments/markdown/SectionRenderingExtension.scala
@@ -35,7 +35,14 @@ object SectionRenderingExtension extends HtmlRenderer.HtmlRendererExtension:
35
val idSuffix = repeatedIds.getOrElseUpdate((c, headerText), 0)
36
val ifSuffixStr = if(idSuffix == 0) then "" else idSuffix.toString
37
repeatedIds.update((c, headerText), idSuffix + 1)
38
- val id = idGenerator.getId(headerText + ifSuffixStr)
+
39
+ /* #19524 flexmark's `HeaderIdGenerator` does not appear to be thread-safe,
40
+ * so we protect its usage with a full `synchronize`.
41
+ */
42
+ val id = idGenerator.synchronized {
43
+ idGenerator.getId(headerText + ifSuffixStr)
44
+ }
45
46
val anchor = AnchorLink(s"#$id")
47
val headerClass: String = header.getLevel match
48
case 1 => "h500"
0 commit comments