chore(dart/_util-fns): make adjustTsExamplePath4Dart idempotent (#1515)

Fixes #1513.
This commit is contained in:
Patrice Chalin 2016-05-25 11:43:06 -07:00 committed by Kathy Walrath
parent 551ac6dc9d
commit ed16d82335
1 changed files with 1 additions and 1 deletions

View File

@ -37,7 +37,7 @@ mixin liveExampleLink2(linkText, exampleUrlPartName)
- // Adjust the folder path, e.g., ts -> dart
- folder = folder.replace(/(^|\/)ts($|\/)/, '$1dart$2').replace(/(^|\/)app($|\/)/, inWebFolder ? '$1web$2' : '$1lib$2');
- // Special case not handled above: e.g., index.html -> web/index.html
- if(baseNameNoExt.match(/^(index|styles)(\.\d)?$/)) folder = (folder ? folder + '/' : '') + 'web';
- if(baseNameNoExt.match(/^(index|styles)(\.\d)?$/) && !folder.match(/web$/)) folder = (folder ? folder + '/' : '') + 'web';
- // In file name, replace special characters with underscore
- baseNameNoExt = baseNameNoExt.replace(/[\-\.]/g, '_');
- // Adjust the file extension