##// END OF EJS Templates
mettags: limit the scope of url => metatag to http, https and / links....
marcink -
r2381:39239f6c default
parent child Browse files
Show More
@@ -947,8 +947,8 b' tags_paterns = OrderedDict(('
947 ('see', (re.compile(r'\[see\ \=\>\ *([a-zA-Z0-9\/\=\?\&\ \:\/\.\-]*)\]'),
947 ('see', (re.compile(r'\[see\ \=\>\ *([a-zA-Z0-9\/\=\?\&\ \:\/\.\-]*)\]'),
948 '<div class="metatag" tag="see">see: \\1 </div>')),
948 '<div class="metatag" tag="see">see: \\1 </div>')),
949
949
950 ('url', (re.compile(r'\[url\ \=\&gt;\ \[([a-zA-Z0-9\ \.\-\_]+)\]\((.*?)\)\]'),
950 ('url', (re.compile(r'\[url\ \=\&gt;\ \[([a-zA-Z0-9\ \.\-\_]+)\]\((http://|https://|/)(.*?)\)\]'),
951 '<div class="metatag" tag="url"> <a href="\\2">\\1</a> </div>')),
951 '<div class="metatag" tag="url"> <a href="\\2\\3">\\1</a> </div>')),
952
952
953 ('license', (re.compile(r'\[license\ \=\&gt;\ *([a-zA-Z0-9\/\=\?\&amp;\ \:\/\.\-]*)\]'),
953 ('license', (re.compile(r'\[license\ \=\&gt;\ *([a-zA-Z0-9\/\=\?\&amp;\ \:\/\.\-]*)\]'),
954 '<div class="metatag" tag="license"><a href="http:\/\/www.opensource.org/licenses/\\1">\\1</a></div>')),
954 '<div class="metatag" tag="license"><a href="http:\/\/www.opensource.org/licenses/\\1">\\1</a></div>')),
@@ -238,6 +238,19 b' def test_age_in_future(age_args, expecte'
238 ]),
238 ]),
239 # entry
239 # entry
240 ((
240 ((
241 "[url =&gt; [linkNameJS](javascript:alert(document.domain))]\n"
242 "[url =&gt; [linkNameHTTP](http://rhodecode.com)]\n"
243 "[url =&gt; [linkNameHTTPS](https://rhodecode.com)]\n"
244 "[url =&gt; [linkNamePath](/repo_group)]\n"
245 ),
246 [
247 ('generic', '[linkNameJS]'),
248 ('url', '[url =&gt; [linkNameHTTP](http://rhodecode.com)]'),
249 ('url', '[url =&gt; [linkNameHTTPS](https://rhodecode.com)]'),
250 ('url', '[url =&gt; [linkNamePath](/repo_group)]'),
251 ]),
252 # entry
253 ((
241 "hello pta[tag] gog [[]] [[] sda ero[or]d [me =&gt;>< sa]"
254 "hello pta[tag] gog [[]] [[] sda ero[or]d [me =&gt;>< sa]"
242 "[requires] [stale] [see<>=&gt;] [see =&gt; http://url.com]"
255 "[requires] [stale] [see<>=&gt;] [see =&gt; http://url.com]"
243 "[requires =&gt; url] [lang =&gt; python] [just a tag] "
256 "[requires =&gt; url] [lang =&gt; python] [just a tag] "
General Comments 0
You need to be logged in to leave comments. Login now