From 4b397b071cce938cefad75d7b56b813bbe7e1c26 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Sat, 23 Mar 2024 21:10:35 +0000 Subject: Filter for PascalCase words --- wiki.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'wiki.py') diff --git a/wiki.py b/wiki.py index 2c4eef9..6c1cf04 100644 --- a/wiki.py +++ b/wiki.py @@ -30,22 +30,26 @@ if DEV: return static_file(filename, root="static/") +# check two words pascal case +app.router.add_filter('pc', lambda conf: (r'[A-Z][a-z]+[A-Z][a-z]*', None, None)) + + @app.route("/") def index(): redirect("/WikiHome") -@app.route("/") +@app.route("/") def page(db, name): return template("page", dict(page=model.get_page(db, name))) -@app.get("/edit/") +@app.get("/edit/") def edit(db, name): return template("edit", dict(page=model.get_page(db, name))) -@app.get("/history/") +@app.get("/history/") def history(db, name): return template( "history", @@ -56,7 +60,7 @@ def history(db, name): ) -@app.get("/history//") +@app.get("/history//") def history_view(db, name, version): return template( "page", @@ -66,7 +70,7 @@ def history_view(db, name, version): ) -@app.post("/edit/") +@app.post("/edit/") def edit_save(db, name): page = model.get_page(db, name) -- cgit v1.2.3