Commit 3bd62f70 by Arjun Jhukal

updated the new toc id

parent ba7c3a74
......@@ -593,13 +593,15 @@
function sanitizeTitle(text) {
return text
.toString()
.trim() // Remove leading and trailing whitespace
.trim() // Remove leading/trailing whitespace
.toLowerCase() // Convert to lowercase
.replace(/[^a-z0-9\s-]/g, "") // Remove special characters
.replace(/\./g, "-") // Replace dots with hyphens
.replace(/[^a-z0-9\s-]/g, "") // Remove special characters (except hyphen and space)
.replace(/\s+/g, "-") // Replace spaces with hyphens
.replace(/-+/g, "-"); // Remove multiple consecutive hyphens
.replace(/-+/g, "-"); // Collapse multiple hyphens
}
$(function () {
$(".blog-detail-content h2, .blog-detail-content h3").each(function () {
var text = $(this).text();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment