From 3c019576463948163bbe4b5898285e06039dab1a Mon Sep 17 00:00:00 2001 From: coolnsx Date: Mon, 9 Jun 2025 12:14:48 +0530 Subject: [PATCH] feat: subheading with custom id generator logic --- templates/shortcodes/link.html | 2 +- templates/shortcodes/subheading.html | 12 +++++++++--- templates/shortcodes/table.html | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/templates/shortcodes/link.html b/templates/shortcodes/link.html index cc1df77..4f7a9a6 100644 --- a/templates/shortcodes/link.html +++ b/templates/shortcodes/link.html @@ -1 +1 @@ -{{ text }} +{{ text }} diff --git a/templates/shortcodes/subheading.html b/templates/shortcodes/subheading.html index bcf91b1..5161746 100644 --- a/templates/shortcodes/subheading.html +++ b/templates/shortcodes/subheading.html @@ -1,4 +1,10 @@ +{% set href = text + | regex_replace(pattern="[\\\/#%<>\[\]\(\)`\\^{}\|.]", rep="") + | regex_replace(pattern=" +", rep="-") + | lower +%} +
-

- {{ text }} -

+ + {{ text | safe }} + diff --git a/templates/shortcodes/table.html b/templates/shortcodes/table.html index 8e2c76b..c1e6869 100644 --- a/templates/shortcodes/table.html +++ b/templates/shortcodes/table.html @@ -1,4 +1,4 @@ -
+