From 0372f30220362b9329cefa8bc88803ae4c4b4e71 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 27 Nov 2013 19:24:41 +0900 Subject: [PATCH] adjust media regexp to not trigger on mce_src otherwise pasting the following will cause an error: --- anki/media.py | 4 ++-- aqt/editor.py | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/anki/media.py b/anki/media.py index 716da58ff..d5e6a34e3 100644 --- a/anki/media.py +++ b/anki/media.py @@ -22,9 +22,9 @@ class MediaManager(object): soundRegexps = ["(?i)(\[sound:(?P[^]]+)\])"] imgRegexps = [ # src element quoted case - "(?i)(]+src=(?P[\"'])(?P[^>]+?)(?P=str)[^>]*>)", + "(?i)(]+ src=(?P[\"'])(?P[^>]+?)(?P=str)[^>]*>)", # unquoted case - "(?i)(]+src=(?!['\"])(?P[^ >]+)[^>]*?>)", + "(?i)(]+ src=(?!['\"])(?P[^ >]+)[^>]*?>)", ] regexps = soundRegexps + imgRegexps diff --git a/aqt/editor.py b/aqt/editor.py index 56fd724e9..e347d6d7e 100644 --- a/aqt/editor.py +++ b/aqt/editor.py @@ -1092,11 +1092,11 @@ class EditorWebView(AnkiWebView): self.savedClip = n def _processMime(self, mime): - print "html=%s image=%s urls=%s txt=%s" % ( - mime.hasHtml(), mime.hasImage(), mime.hasUrls(), mime.hasText()) - print "html", mime.html() - print "urls", mime.urls() - print "text", mime.text() + # print "html=%s image=%s urls=%s txt=%s" % ( + # mime.hasHtml(), mime.hasImage(), mime.hasUrls(), mime.hasText()) + # print "html", mime.html() + # print "urls", mime.urls() + # print "text", mime.text() if mime.hasHtml(): return self._processHtml(mime) elif mime.hasUrls():