Skip to content

HTML-encode attributes in <tspan>s and <a>s #791

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 29, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add test that relative links work
  • Loading branch information
scjody committed Jul 29, 2016
commit 763485c7577ef2bcff156da46e3d71989d12fe3f
10 changes: 10 additions & 0 deletions test/jasmine/tests/svg_text_utils_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,16 @@ describe('svg+text utils', function() {
assertAnchorLink(node, null);
});

it('whitelist relative hrefs (interpreted as http)', function() {
var node = mockTextSVGElement(
'<a href="/mylink">mylink</a>'
);

expect(node.text()).toEqual('mylink');
assertAnchorAttrs(node);
assertAnchorLink(node, '/mylink');
});

it('whitelist http hrefs', function() {
var node = mockTextSVGElement(
'<a href="http://bl.ocks.org/">bl.ocks.org</a>'
Expand Down