Defect #36901 » 36901.patch
| lib/redmine/wiki_formatting/common_mark/external_links_filter.rb | ||
|---|---|---|
|
next unless url
|
||
|
next if url.starts_with?("/") || url.starts_with?("#") || !url.include?(':')
|
||
|
scheme = URI.parse(url).scheme
|
||
|
begin
|
||
|
scheme = URI.parse(url).scheme
|
||
|
rescue URI::InvalidURIError
|
||
|
scheme = nil
|
||
|
end
|
||
|
next if scheme.blank?
|
||
|
klass = node["class"].presence
|
||
| public/stylesheets/application.css | ||
|---|---|---|
|
#quick-search {float:right;}
|
||
|
#quick-search #q {width:130px; height:24px; box-sizing:border-box; vertical-align:middle; border:1px solid #ccc; border-radius:3px;}
|
||
|
#quick-search form {display: inline-block;}
|
||
|
#main-menu {position: absolute; bottom: 0px; left: 10px; margin-right: -500px; width: 100%;}
|
||
|
#main-menu ul {margin: 0; padding: 0; width: 100%; white-space: nowrap;}
|
||
| test/unit/lib/redmine/wiki_formatting/common_mark/external_links_filter_test.rb | ||
|---|---|---|
|
def test_mailto_links_should_have_email_class
|
||
|
assert_equal %(<a href="mailto:user@example.org" class="email">user</a>), filter(%(<a href="mailto:user@example.org">user</a>))
|
||
|
end
|
||
|
def test_malformed_uri_should_not_cause_exception
|
||
|
assert_nothing_raised do
|
||
|
filter(%(<a href="http://example.com/foo#bar#">Malformed URI</a>))
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|
||