From 296f3d7ab0ac6adaaa57fa8ef7807bb0315a0dcf Mon Sep 17 00:00:00 2001 From: Cristina Cochior Date: Sat, 4 May 2019 16:57:38 +0200 Subject: [PATCH] new --- contextualise.py | 3 +++ generate_links.py | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/contextualise.py b/contextualise.py index 0102cd6..2bc9d6d 100644 --- a/contextualise.py +++ b/contextualise.py @@ -118,6 +118,9 @@ def description(): if file.lower().endswith(('.html')): with open("static/"+file,"r", encoding='utf-8') as f: textfile = f.read() + word = "way" + wordlinked = ""+word+"" + textfile = re.sub(word, wordlinked, textfile) textfile = Markup(textfile) return render_template('description.html', datafromjson=datafromjson, itemid=itemid, textfile=textfile, idno=idno) diff --git a/generate_links.py b/generate_links.py index c2c0fd3..0658602 100644 --- a/generate_links.py +++ b/generate_links.py @@ -15,4 +15,9 @@ for path, subdirs, files in os.walk(path): textfile = f.read() for word in wordlist_dict: wordlinked = ""+word+"" - textfile = re.sub(word, wordlinked, textfile) + # wordlinked = re.escape(wordlinked) + print(wordlinked) + # word = re.escape(word) + print(word) + # textfile = re.sub(word, wordlinked, textfile) +# print(textfile)