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

Internal hrefs should be resolved after componentization #3

Open
joseph opened this issue Oct 6, 2010 · 5 comments
Open

Internal hrefs should be resolved after componentization #3

joseph opened this issue Oct 6, 2010 · 5 comments

Comments

@joseph
Copy link
Owner

joseph commented Oct 6, 2010

If a single file is split up into many HTML files by the componentizer, any internal URLs (such as "#part6") will no longer work. When saving the components, we should comb through them for "a[href=/^(index.html)?#/]" and find the component to which the href is referring, prepending this to the href.

We don't have to worry about this for other hrefs, like img#src or link#href, since the things they point to will already work. Unless we're worried about JavaScript (and I'm not), a#href is the only attribute I think we need to update.

@frank06
Copy link

frank06 commented Mar 10, 2011

I'm actually needing this. Are there any updates? Otherwise I could try to come up with a patch

@joseph
Copy link
Owner Author

joseph commented Mar 12, 2011

I don't think I've done any work on this, so a patch would be much appreciated.

@frank06
Copy link

frank06 commented Mar 16, 2011

What do you think about this? https://github.com/frank06/peregrin/commit/24e957bee27d6c47dda15c1af89af724870b78b8

(There might be an easier way than re-parsing the parts to find IDs, not sure)

@joseph
Copy link
Owner Author

joseph commented Mar 17, 2011

Looks pretty good to me. Couple things:

  • Do we need to handle <a name=""> as well? Or is this jettisoned in HTML5?
  • Can I get a test? :)

@frank06
Copy link

frank06 commented Mar 19, 2011

Check my latest commits.

  • Support for a[name]
  • Initial test which is more of a shot in the dark. I can't get tests running (it's segfaulting in the zip lib I think)

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

2 participants