diff --git a/test/tm-cases/link_patterns_escape.html b/test/tm-cases/link_patterns_escape.html new file mode 100644 index 00000000..20c42eb4 --- /dev/null +++ b/test/tm-cases/link_patterns_escape.html @@ -0,0 +1,9 @@ +

Recipe 123 and a link to Komodo bug 234 are related.

+ +

This is a link which has a pattern inside the url that shouldn't expand.

+ +

Matched pattern is escaped: PEP 42 might be related too.

+ +

Triple quotes not surrounding a matched pattern: PEP """42""" might be related too.

+ +

"""This is some random text which should not be touched."""

diff --git a/test/tm-cases/link_patterns_escape.opts b/test/tm-cases/link_patterns_escape.opts new file mode 100644 index 00000000..440d5a6d --- /dev/null +++ b/test/tm-cases/link_patterns_escape.opts @@ -0,0 +1,8 @@ +{"extras": ["link-patterns"], + "link_patterns": [ + (re.compile("recipe\s+(\d+)", re.I), r"http://code.activestate.com/recipes/\1/"), + (re.compile("(?:komodo\s+)?bug\s+(\d+)", re.I), r"http://bugs.activestate.com/show_bug.cgi?id=\1"), + (re.compile("PEP\s+(\d+)", re.I), lambda m: "http://www.python.org/dev/peps/pep-%04d/" % int(m.group(1))), + ], +} + diff --git a/test/tm-cases/link_patterns_escape.text b/test/tm-cases/link_patterns_escape.text new file mode 100644 index 00000000..e4cf48af --- /dev/null +++ b/test/tm-cases/link_patterns_escape.text @@ -0,0 +1,9 @@ +"""Recipe 123""" and a link to """Komodo bug 234""" are related. + +This is a link which has a pattern inside the url that shouldn't expand. + +Matched pattern is escaped: """PEP 42""" might be related too. + +Triple quotes not surrounding a matched pattern: PEP """42""" might be related too. + +"""This is some random text which should not be touched."""