chore(dart/_util-fns): make adjustTsExamplePath4Dart idempotent (#1515)
Fixes #1513.
This commit is contained in:
parent
551ac6dc9d
commit
ed16d82335
|
@ -37,7 +37,7 @@ mixin liveExampleLink2(linkText, exampleUrlPartName)
|
||||||
- // Adjust the folder path, e.g., ts -> dart
|
- // Adjust the folder path, e.g., ts -> dart
|
||||||
- folder = folder.replace(/(^|\/)ts($|\/)/, '$1dart$2').replace(/(^|\/)app($|\/)/, inWebFolder ? '$1web$2' : '$1lib$2');
|
- 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
|
- // 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
|
- // In file name, replace special characters with underscore
|
||||||
- baseNameNoExt = baseNameNoExt.replace(/[\-\.]/g, '_');
|
- baseNameNoExt = baseNameNoExt.replace(/[\-\.]/g, '_');
|
||||||
- // Adjust the file extension
|
- // Adjust the file extension
|
||||||
|
|
Loading…
Reference in New Issue