From a318abb2efdba5a38bfca37ff423cc7b407368b3 Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Wed, 25 May 2016 08:14:58 -0700 Subject: [PATCH] chore(dart/_util-fns): make adjustTsExamplePath4Dart idempotent Fixes #1513. --- public/docs/dart/latest/_util-fns.jade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/docs/dart/latest/_util-fns.jade b/public/docs/dart/latest/_util-fns.jade index 98be78138f..dedea10893 100644 --- a/public/docs/dart/latest/_util-fns.jade +++ b/public/docs/dart/latest/_util-fns.jade @@ -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