diff --git a/controller/Html_cleaner.py b/controller/Html_cleaner.py
index 9bbfb3d..5eb7049 100644
--- a/controller/Html_cleaner.py
+++ b/controller/Html_cleaner.py
@@ -18,7 +18,7 @@ class Html_cleaner(HTMLParser):
"""
Cleans HTML of any tags not matching a whitelist.
"""
- NOTE_LINK_URL_PATTERN = re.compile( '[^"]*/notebooks/\w+\?note_id=\w+', re.IGNORECASE )
+ NOTE_LINK_URL_PATTERN = re.compile( '[^"]*/notebooks/\w+\?[^"]*note_id=\w+', re.IGNORECASE )
def __init__( self, require_link_target = False ):
HTMLParser.__init__( self, AbstractFormatter( NullWriter() ) )
diff --git a/controller/Notebooks.py b/controller/Notebooks.py
index 870eb63..53657cd 100644
--- a/controller/Notebooks.py
+++ b/controller/Notebooks.py
@@ -1895,7 +1895,7 @@ class Notebooks( object ):
( rewritten_contents, rewritten_count ) = self.NOTE_LINK_PATTERN.subn( rewrite_link, note.contents )
if rewritten_count > 0:
note.contents = rewritten_contents
- self.__database.save( note )
+ self.__database.save( note, commit = False )
# delete the CSV file now that it's been imported
self.__database.execute( db_file.sql_delete(), commit = False )