From 2d0264116cd56b49097fe7ba28be762c58ab6118 Mon Sep 17 00:00:00 2001 From: Jeremy Barlow Date: Mon, 29 Jan 2018 15:27:34 -0800 Subject: [PATCH] Handle at sign in module example path for UI import menu This commit allows an example from an npm package that has an org scoped name (which includes an @ character) to be abbreviated properly in the import menu - i.e., showing 'myexample' for a package name of '@myorg/node-red-contrib-myexample' rather than '@myorg/node red-contrib-myexample'. --- editor/js/ui/library.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/js/ui/library.js b/editor/js/ui/library.js index a8c75695b..8c29ccae8 100644 --- a/editor/js/ui/library.js +++ b/editor/js/ui/library.js @@ -38,7 +38,7 @@ RED.library = (function() { li.className = "dropdown-submenu pull-left"; a = document.createElement("a"); a.href="#"; - var label = i.replace(/^node-red-contrib-/,"").replace(/^node-red-node-/,"").replace(/-/," ").replace(/_/," "); + var label = i.replace(/^@.*\//,"").replace(/^node-red-contrib-/,"").replace(/^node-red-node-/,"").replace(/-/," ").replace(/_/," "); a.innerHTML = label; li.appendChild(a); li.appendChild(buildMenu(data.d[i],root+(root!==""?"/":"")+i));