Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

fix anchor link generator for camel cased acronyms

0div4161d41795d9
diff --git a/apps/web/prebuild.js b/apps/web/prebuild.js
index ff1b60951..169d025c4 100644
--- a/apps/web/prebuild.js
+++ b/apps/web/prebuild.js
@@ -49,7 +49,9 @@ function toAnchorLink(title) {
// Remove special characters except dashes and spaces
title = title.replace(/[^a-zA-Z0-9\- ]/g, '')
// Add dashes between words for camelCase
- title = title.replace(/([a-z])([A-Z])/g, '$1-$2')
+ title = title
+ .replace(/([A-Z]+)([A-Z][a-z])/g, '$1-$2')
+ .replace(/([a-z])([A-Z])/g, '$1-$2')
return '#' + title.toLowerCase().replace(/ /g, '-')
}