Skip to content

Conversation

shlomiassaf
Copy link
Contributor

A plugin might set the url property on a reflection before the rendering phase.

The rendering plugins (and the theme) does not care, they will overwrite it.

This PR adds a check before overwrite, if the URL is absolute (http, https, ftp) the URL generation will stop since its an external link.

Shlomi Assaf (shlassaf) added 2 commits September 15, 2017 02:15
@blakeembrey blakeembrey merged commit f7d27e5 into TypeStrong:master Sep 22, 2017

/**
* Regular expression to test if a string looks like an external url.
*/
Copy link
Member

Choose a reason for hiding this comment

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

Do you think we should just do /^\w{1,10}:\/\// to ignore everything that looks absolute?

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 guess you're right here, I just wanted to PR a fix, changing to such a general thing might be a breaking change

@shlomiassaf shlomiassaf deleted the respect-absolute-urls branch October 15, 2017 01:30
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

Successfully merging this pull request may close these issues.

3 participants