Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Make anchors in Quick Docs relative to page URL #8724

Merged
merged 4 commits into from
Nov 13, 2014

Conversation

marcelgerber
Copy link
Contributor

For #8718.

url = templateVars.url + url;
} else if (url.substr(0, 4) !== "http") {
// URLs in JSON data are relative
url = "http://docs.webplatform.org" + (url.indexOf("/") !== 0 ? "/" : "") + url;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious as to why you changed from using url.charAt(0) !== "/" to url.indexOf("/") !== 0 ? charAt() is more efficient because it only checks the first char for a slash, where indexOf() will keep checking chars until it finds a slash or end-of-string (even though you're only interested in the first char).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why I did that. Just changed it back.

@redmunds
Copy link
Contributor

Thanks. Merging.

redmunds added a commit that referenced this pull request Nov 13, 2014
Make anchors in Quick Docs relative to page URL
@redmunds redmunds merged commit 4b3453e into adobe:master Nov 13, 2014
@marcelgerber marcelgerber deleted the wp-docs-anchors branch November 13, 2014 16:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants