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

fix: ignore URLs in <link href> #553

merged 4 commits into from Jan 24, 2019


None yet
1 participant
Copy link

commented Jan 24, 2019


  • Adds a warning if there are multiple <link> elements in a file, processes only the first
  • Ignores elements when the href attribute is a URL
  • Early-out if all the <link> elements are to URLs
  • Removes trailing newlines when stripping out replaced <link>, which looks nicer

Motivation and Context

Wanted to be able to mix local <link> that should be transformed with external CSS that shouldn't be.

How Has This Been Tested?


Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)


  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@tivac tivac self-assigned this Jan 24, 2019

@tivac tivac force-pushed the svelte-ignore-urls branch from 0fa6f64 to 93aa2d9 Jan 24, 2019


This comment has been minimized.

Copy link

commented Jan 24, 2019

Codecov Report

Merging #553 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #553      +/-   ##
+ Coverage   98.92%   98.94%   +0.01%     
  Files          46       46              
  Lines        1026     1041      +15     
  Branches      157      160       +3     
+ Hits         1015     1030      +15     
  Misses         11       11
Impacted Files Coverage Δ
packages/svelte/svelte.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fae0b99...93aa2d9. Read the comment docs.

@tivac tivac merged commit 16ec1d9 into master Jan 24, 2019

4 checks passed

codecov/patch 100% of diff hit (target 98.92%)
codecov/project 98.94% (+0.01%) compared to fae0b99
continuous-integration/travis-ci/pr The Travis CI build passed
continuous-integration/travis-ci/push The Travis CI build passed

@tivac tivac deleted the svelte-ignore-urls branch Jan 24, 2019

tivac added a commit that referenced this pull request Jan 24, 2019

fix: ignore URLs in <link href> (#553)
* fix: svelte preprocessor ignores URLs

* test: add test for URL ignoring functionality

* fix: warn when multiple <link> elements are used

* fix: no-op if all <link> are invalid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.