##// END OF EJS Templates
mettags: limit the scope of url => metatag to http, https and / links....
marcink -
r2253:05321885 stable
parent child Browse files
Show More
@@ -960,8 +960,8 b' tags_paterns = OrderedDict(('
960 ('see', (re.compile(r'\[see\ \=\>\ *([a-zA-Z0-9\/\=\?\&\ \:\/\.\-]*)\]'),
960 ('see', (re.compile(r'\[see\ \=\>\ *([a-zA-Z0-9\/\=\?\&\ \:\/\.\-]*)\]'),
961 '<div class="metatag" tag="see">see: \\1 </div>')),
961 '<div class="metatag" tag="see">see: \\1 </div>')),
962
962
963 ('url', (re.compile(r'\[url\ \=\&gt;\ \[([a-zA-Z0-9\ \.\-\_]+)\]\((.*?)\)\]'),
963 ('url', (re.compile(r'\[url\ \=\&gt;\ \[([a-zA-Z0-9\ \.\-\_]+)\]\((http://|https://|/)(.*?)\)\]'),
964 '<div class="metatag" tag="url"> <a href="\\2">\\1</a> </div>')),
964 '<div class="metatag" tag="url"> <a href="\\2\\3">\\1</a> </div>')),
965
965
966 ('license', (re.compile(r'\[license\ \=\&gt;\ *([a-zA-Z0-9\/\=\?\&amp;\ \:\/\.\-]*)\]'),
966 ('license', (re.compile(r'\[license\ \=\&gt;\ *([a-zA-Z0-9\/\=\?\&amp;\ \:\/\.\-]*)\]'),
967 '<div class="metatag" tag="license"><a href="http:\/\/www.opensource.org/licenses/\\1">\\1</a></div>')),
967 '<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