Vote #79750
未完了Textile formatter generates broken link if a URL is followed by a tag
0%
説明
[Input]
http://www.example.com/
[Expected output]
http://www.example.com/<foo>
[Actual output]
http://www.example.com/<foo
!{width: 256px; border: 1px solid #ccc;}.broken-link@2x.png!
journals
I improved the regular expression to exclude subsequent characters on "&lt;" from a URL.
I attached patches.
<pre><code class="diff">
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 )
</code></pre>
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Admin Redmine さんが約2年前に更新
- カテゴリ を Text formatting_26 にセット
- 対象バージョン を Candidate for next minor release_33 にセット