From: Charles Holbrow Date: Fri, 18 Jan 2013 23:57:19 +0000 (-0500) Subject: adding regex to reimport javascript escaped strings when importing html X-Git-Tag: release-20150131~553 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=487465a73d1c2852b2dc67eba21dbfe2854b5fef;p=oweals%2Fkarmaworld.git adding regex to reimport javascript escaped strings when importing html --- diff --git a/bin/import_json/run.py b/bin/import_json/run.py index de362f7..7bb1e26 100644 --- a/bin/import_json/run.py +++ b/bin/import_json/run.py @@ -13,6 +13,7 @@ import os import shutil import datetime import taggit +import re from os.path import join, exists, split, isdir @@ -109,6 +110,10 @@ for note in note_dicts: try: n = Note(**note) + # fix the weird javascript issue + if n.html: + n.html = re.sub(r'\\(.)', r'\1', n.html) + # Add the tags, if any for t in tags: n.tags.add(t)