From 5c55ec7fcb338306188dac3454782a190205152e Mon Sep 17 00:00:00 2001 From: Spencer Williams Date: Fri, 11 Jul 2025 13:52:01 -0400 Subject: Add raw-title template var --- lisp/seam-export.el | 12 ++++++++++-- lisp/seam-test.el | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'lisp') diff --git a/lisp/seam-export.el b/lisp/seam-export.el index 8be9404..6f75a21 100644 --- a/lisp/seam-export.el +++ b/lisp/seam-export.el @@ -113,7 +113,7 @@ See `seam-export-alist' for more information about specifying templates."
-

{{title}}

+

{{{raw-title}}}

Last modified:

{{{contents}}} @@ -137,7 +137,12 @@ interpolate it as-is. `title' - The note's title (HTML-escaped). + The note's title, in a plain text format suitable for a + tag. + + `raw-title' + + The note's title, in an HTML format suitable for an <h1> tag. `backlinks' @@ -272,6 +277,9 @@ notes)." `(("title" . ,(seam-export--smartquotize-string (seam-get-title-from-file note-file))) + ("raw-title" . + ,(seam-export--escape-string + (seam-get-title-from-file note-file))) ("modified" . ,(format-time-string seam-export-time-format diff --git a/lisp/seam-test.el b/lisp/seam-test.el index a546319..47d4fbb 100644 --- a/lisp/seam-test.el +++ b/lisp/seam-test.el @@ -509,8 +509,8 @@ it." (ert-deftest seam-test-escape-title () (should (equal - "“quotes” & <symbols>\n" - (seam-test-with-notes ((seam-export-template-string "{{{title}}}")) + "“quotes” & <symbols>\n“quotes” & <symbols>\n" + (seam-test-with-notes ((seam-export-template-string "{{title}}\n{{{raw-title}}}")) ((note "\"quotes\" & <symbols>" "public")) (seam-export--file-string "html/quotes-symbols.html"))))) -- cgit v1.2.3