[PR #33] [MERGED] Use template strings for substitution in HTML output #1039

Closed
opened 2026-03-01 14:48:11 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ArchiveBox/ArchiveBox/pull/33
Author: @bardisty
Created: 7/5/2017
Status: Merged
Merged: 7/5/2017
Merged by: @pirate

Base: masterHead: add-template-strings


📝 Commits (3)

  • 31ec320 Use template strings for substitution in HTML output
  • 28445d2 Remove obsolete note on double-bracketed CSS in templates
  • 26b5e4a Use $identifier over ${identifier}

📊 Changes

4 files changed (+39 additions, -40 deletions)

View changed files

📝 README.md (+0 -2)
📝 index.py (+3 -2)
📝 templates/index.html (+26 -26)
📝 templates/index_row.html (+10 -10)

📄 Description

str.format() can only use substitutions identified by braces ({ and }). This has the potential to conflict with other code in the HTML template, such as CSS or JavaScript.

Template strings can use substitutions identified by $ or ${}, e.g.: $identifier or ${identifier}. These substitutions won't conflict with CSS or JavaScript, allowing users to write HTML templates that don't require double braces anywhere there's a substitution conflict. This is especially useful when one is using a build tool to generate the final CSS/JavaScript/HTML.

https://docs.python.org/3/library/string.html#template-strings


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ArchiveBox/ArchiveBox/pull/33 **Author:** [@bardisty](https://github.com/bardisty) **Created:** 7/5/2017 **Status:** ✅ Merged **Merged:** 7/5/2017 **Merged by:** [@pirate](https://github.com/pirate) **Base:** `master` ← **Head:** `add-template-strings` --- ### 📝 Commits (3) - [`31ec320`](https://github.com/ArchiveBox/ArchiveBox/commit/31ec3203c5222d0ccc10ca14580c18786ac7a52e) Use template strings for substitution in HTML output - [`28445d2`](https://github.com/ArchiveBox/ArchiveBox/commit/28445d26e86187569432e4e294083effc5020552) Remove obsolete note on double-bracketed CSS in templates - [`26b5e4a`](https://github.com/ArchiveBox/ArchiveBox/commit/26b5e4aa3c23078ae77c8541099dfbf211bbe130) Use `$identifier` over `${identifier}` ### 📊 Changes **4 files changed** (+39 additions, -40 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+0 -2) 📝 `index.py` (+3 -2) 📝 `templates/index.html` (+26 -26) 📝 `templates/index_row.html` (+10 -10) </details> ### 📄 Description `str.format()` can only use substitutions identified by braces (`{` and `}`). This has the potential to conflict with other code in the HTML template, such as CSS or JavaScript. Template strings can use substitutions identified by `$` or `${}`, e.g.: `$identifier` or `${identifier}`. These substitutions won't conflict with CSS or JavaScript, allowing users to write HTML templates that don't require double braces anywhere there's a substitution conflict. This is especially useful when one is using a build tool to generate the final CSS/JavaScript/HTML. https://docs.python.org/3/library/string.html#template-strings --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-01 14:48:11 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ArchiveBox#1039
No description provided.