From 29ae18253229c3cadb805483dccadae56dd2ef7f Mon Sep 17 00:00:00 2001 From: Massimo Di Pierro Date: Thu, 8 Dec 2011 09:58:52 -0600 Subject: [PATCH] auto qr codes in markmin --- VERSION | 2 +- gluon/contrib/markmin/markmin2html.py | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/VERSION b/VERSION index 2df32fc5..aa82682f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 1.99.3 (2011-12-08 09:47:31) dev +Version 1.99.3 (2011-12-08 09:58:39) dev diff --git a/gluon/contrib/markmin/markmin2html.py b/gluon/contrib/markmin/markmin2html.py index afe60b9d..2c3f7c8d 100755 --- a/gluon/contrib/markmin/markmin2html.py +++ b/gluon/contrib/markmin/markmin2html.py @@ -267,10 +267,11 @@ regex_audio = re.compile('\[\[(?P[^\]]*?) +(?P\S+) +audio\]\]') regex_link = re.compile('\[\[(?P[^\]]*?) +(?P\S+)\]\]') regex_link_popup = re.compile('\[\[(?P[^\]]*?) +(?P\S+) popup\]\]') regex_link_no_anchor = re.compile('\[\[ +(?P\S+)\]\]') -regex_embed = re.compile('(?])embed:(?P\w+://[\w\.\-\+\?&%\/]+)',re.M) -regex_auto_video = re.compile('(?])(?P\w+://[\w\.\-\+\?&%\/]+\.(mp4|mpeg|mov))',re.M) -regex_auto_audio = re.compile('(?])(?P\w+://[\w\.\-\+\?&%\/]+\.(mp3|wav))',re.M) -regex_auto = re.compile('(?])(?P\w+://[\w\.\-\+\?&%\/]+)',re.M) +regex_qr = re.compile('(?/=])qr:(?P\w+://[\w\.\-\+\?&%\/]+)',re.M) +regex_embed = re.compile('(?/=])embed:(?P\w+://[\w\.\-\+\?&%\/]+)',re.M) +regex_auto_video = re.compile('(?/=])(?P\w+://[\w\.\-\+\?&%\/]+\.(mp4|mpeg|mov))',re.M) +regex_auto_audio = re.compile('(?/=])(?P\w+://[\w\.\-\+\?&%\/]+\.(mp3|wav))',re.M) +regex_auto = re.compile('(?/=])(?P\w+://[\w\.\-\+\?&%\/]+)',re.M) def render(text,extra={},allowed={},sep='p'): """ @@ -398,6 +399,7 @@ def render(text,extra={},allowed={},sep='p'): text = regex_link.sub('\g', text) text = regex_embed.sub('', text) + text = regex_qr.sub('', text) text = regex_auto_video.sub('', text) text = regex_auto_audio.sub('', text) text = regex_auto.sub('\g', text)