Commit 3bd62f70 by Arjun Jhukal

updated the new toc id

parent ba7c3a74
...@@ -593,13 +593,15 @@ ...@@ -593,13 +593,15 @@
function sanitizeTitle(text) { function sanitizeTitle(text) {
return text return text
.toString() .toString()
.trim() // Remove leading and trailing whitespace .trim() // Remove leading/trailing whitespace
.toLowerCase() // Convert to lowercase .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(/\s+/g, "-") // Replace spaces with hyphens
.replace(/-+/g, "-"); // Remove multiple consecutive hyphens .replace(/-+/g, "-"); // Collapse multiple hyphens
} }
$(function () { $(function () {
$(".blog-detail-content h2, .blog-detail-content h3").each(function () { $(".blog-detail-content h2, .blog-detail-content h3").each(function () {
var text = $(this).text(); 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