Defect #36901 » 36901.patch
lib/redmine/wiki_formatting/common_mark/external_links_filter.rb | ||
---|---|---|
31 | 31 |
next unless url |
32 | 32 |
next if url.starts_with?("/") || url.starts_with?("#") || !url.include?(':') |
33 | 33 | |
34 |
scheme = URI.parse(url).scheme |
|
34 |
begin |
|
35 |
scheme = URI.parse(url).scheme |
|
36 |
rescue URI::InvalidURIError |
|
37 |
scheme = nil |
|
38 |
end |
|
35 | 39 |
next if scheme.blank? |
36 | 40 | |
37 | 41 |
klass = node["class"].presence |
public/stylesheets/application.css | ||
---|---|---|
45 | 45 | |
46 | 46 |
#quick-search {float:right;} |
47 | 47 |
#quick-search #q {width:130px; height:24px; box-sizing:border-box; vertical-align:middle; border:1px solid #ccc; border-radius:3px;} |
48 |
#quick-search form {display: inline-block;} |
|
48 | 49 | |
49 | 50 |
#main-menu {position: absolute; bottom: 0px; left: 10px; margin-right: -500px; width: 100%;} |
50 | 51 |
#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 | ||
---|---|---|
44 | 44 |
def test_mailto_links_should_have_email_class |
45 | 45 |
assert_equal %(<a href="mailto:user@example.org" class="email">user</a>), filter(%(<a href="mailto:user@example.org">user</a>)) |
46 | 46 |
end |
47 | ||
48 |
def test_malformed_uri_should_not_cause_exception |
|
49 |
assert_nothing_raised do |
|
50 |
filter(%(<a href="http://example.com/foo#bar#">Malformed URI</a>)) |
|
51 |
end |
|
52 |
end |
|
47 | 53 |
end |
48 | 54 |
end |