From 34bd802c8aceb699c3bbfc6513474a78e8598ad0 Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Thu, 2 Aug 2018 20:27:25 -0500 Subject: [PATCH] Escape # (sort of) correctly. --- posts/newsletter/1/info.yaml | 2 +- update-post | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/posts/newsletter/1/info.yaml b/posts/newsletter/1/info.yaml index fb45f14..ef5fe9d 100644 --- a/posts/newsletter/1/info.yaml +++ b/posts/newsletter/1/info.yaml @@ -1,4 +1,4 @@ --- -title: This Week in Lubuntu Development \#1 +title: This Week in Lubuntu Development POUND1 slug: this-week-in-lubuntu-development-1 type: newsletter diff --git a/update-post b/update-post index 28396c9..f8fad4e 100755 --- a/update-post +++ b/update-post @@ -65,6 +65,8 @@ def updatepost(infoyaml, md, post=None, title=None, slug=None): if not slug: slug = infoyaml["slug"] + title = title.replace("POUND", "#") + post.title = title post.content = md post.post_status = "publish" @@ -84,7 +86,7 @@ def main(): post = None for post in posts: - if post.title == infoyaml["title"]: + if post.title == infoyaml["title"].replace("POUND", "#"): updatepost(post=post, title=post.title, infoyaml=infoyaml, md=md) post = True break