TheLarkInn / angular2-template-loader

Chain-to loader for webpack that inlines all html and style's in angular2 components.
MIT License
205 stars 70 forks source link

Make the ending comma/curlybrace after templateUrl optional. #67

Open Riobe opened 7 years ago

Riobe commented 7 years ago

I'm not sure if this is foolproof for all use cases this loaders is being used in. I've only tested it against my own app and saw it working. It simply makes the comma at the end of the line optional.

This will be a WIP until I get the tests passing.

If there are no downsides to this, then it should fix #50 and #58.

codecov-io commented 7 years ago

Codecov Report

Merging #67 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #67   +/-   ##
=======================================
  Coverage   96.42%   96.42%           
=======================================
  Files           1        1           
  Lines          28       28           
  Branches        5        5           
=======================================
  Hits           27       27           
  Misses          1        1
Impacted Files Coverage Δ
index.js 96.42% <100%> (ø) :arrow_up:

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 c2dc887...df9ce1c. Read the comment docs.

Riobe commented 7 years ago

Second commit changes the pull request to essentially switch the "match until you find a quote, double quote, or backtick" to "match until you find a quote, double quote, or backtick that doesn't follow a backslash".

This works for all the test cases and for my personal app. Any other suggestions would be very welcome.