Skip to content
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

Fragments in links get rewritten to point to directory of import #339

Closed
jyasskin opened this issue Nov 6, 2013 · 2 comments
Closed

Fragments in links get rewritten to point to directory of import #339

jyasskin opened this issue Nov 6, 2013 · 2 comments
Assignees

Comments

@jyasskin
Copy link

jyasskin commented Nov 6, 2013

Given the following two files, the <a href> is rewritten to "subdir/#ref". If the href is filled using data-binding (href="#{{ref}}"), it doesn't get broken.

test-import.html:

<!DOCTYPE html>
<html>
<head>
  <script src="polymer.min.js"></script>
  <link rel="import" href="subdir/test-elem.html"/>
</head>
<body>
<test-elem></test-elem>
<p id="ref">Target</p>
</body>
</html>

subdir/test-elem.html:

<polymer-element name="test-elem" noscript>
  <template>I'm a <a href="#ref">link!</template>
</polymer-element>
@sjmiles
Copy link
Contributor

sjmiles commented Nov 6, 2013

It's a feature of the HTML Imports polyfill that static urls are rewritten to resolve as relative to the import itself. This important feature allows imports to be relocatable.

No rewriting is done for dynamic urls, e.g. bindings.

@ghost ghost assigned dfreedm Nov 6, 2013
@tjsavage
Copy link
Contributor

Closing, as it looks to be resolved. Please re-open if still an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants