generate_descriptor_pages.main.kts: Fix case when an element link is before an attribute link

This commit is contained in:
Karol Lewandowski 2024-12-20 11:43:55 +01:00
parent 5c671df2e5
commit 35a4c71f96

View File

@ -399,7 +399,7 @@ fun String.cleanupElementLinks(): String {
}
fun String.removeAttributeLinks(): String {
val attributeLinkRegex = Regex("\\[(.*?)]\\(#attribute:.*?\\)")
val attributeLinkRegex = Regex("\\[([^\\[\\]]*?)]\\(#attribute:.*?\\)")
return attributeLinkRegex.replace(this) { matchResult ->
matchResult.groupValues[1]
}