Actions
Defect #30371
openTextile formatter generates broken link if a URL is followed by a tag
Status:
New
Priority:
Normal
Assignee:
-
Category:
Text formatting
Target version:
Start date:
Due date:
% Done:
0%
Estimated time:
Resolution:
Affected version:
Description
[Input]
http://www.example.com/<foo>
[Expected output]
<a class="external" href="http://www.example.com/">http://www.example.com/</a><foo>
[Actual output]
<a class="external" href="http://www.example.com/&lt;foo">http://www.example.com/&lt;foo</a>
Files
Updated by Yuichi HARADA almost 6 years ago
- File 0001-Remove-unnecessary-trailing-white-spaces.patch 0001-Remove-unnecessary-trailing-white-spaces.patch added
- File 0002-URL-followed-by-tag.patch 0002-URL-followed-by-tag.patch added
I improved the regular expression to exclude subsequent characters on "<" from a URL.
I attached patches.
diff --git a/lib/redmine/wiki_formatting.rb b/lib/redmine/wiki_formatting.rb
index 66764551d..8bd8f64bc 100644
--- a/lib/redmine/wiki_formatting.rb
+++ b/lib/redmine/wiki_formatting.rb
@@ -126,7 +126,7 @@ module Redmine
(\/)? # slash
)
((?:>)?|[^[:alnum:]_\=\/;\(\)]*?) # post
- (?=<|\s|$)
+ (?=<|<|\s|$)
}x unless const_defined?(:AUTO_LINK_RE)
# Destructively replaces urls into clickable links
diff --git a/lib/redmine/wiki_formatting/textile/redcloth3.rb b/lib/redmine/wiki_formatting/textile/redcloth3.rb
index 9107da611..ff0621b9f 100644
--- a/lib/redmine/wiki_formatting/textile/redcloth3.rb
+++ b/lib/redmine/wiki_formatting/textile/redcloth3.rb
@@ -830,7 +830,7 @@ class RedCloth3 < String
(\/)? # $slash
([^[:alnum:]_\=\/;\(\)]*?) # $post
)
- (?=<|\s|$)
+ (?=<|<|\s|$)
/x
#"
def inline_textile_link( text )
Updated by Go MAEDA almost 6 years ago
- Target version set to Candidate for next minor release
Actions