asdfasdf
".Replace(Environment.NewLine, string.Empty), result.Replace(Environment.NewLine, string.Empty)); } + [Test] + public void Format_RTE_Data_For_Editor_With_Multiple_Macros() + { + var content = @"asdfasdf
+ +asdfsadf
++ +
"; + var result = MacroTagParser.FormatRichTextPersistedDataForEditor(content, new Dictionary
asdfasdf
+asdfsadf
++
".Replace(Environment.NewLine, string.Empty), result.Replace(Environment.NewLine, string.Empty)); + } + [Test] public void Format_RTE_Data_For_Editor_With_Params_Closing_Tag() { diff --git a/src/Umbraco.Tests/Strings/StringExtensionsTests.cs b/src/Umbraco.Tests/Strings/StringExtensionsTests.cs index 1bc4661de7..d47e7a21b2 100644 --- a/src/Umbraco.Tests/Strings/StringExtensionsTests.cs +++ b/src/Umbraco.Tests/Strings/StringExtensionsTests.cs @@ -24,6 +24,19 @@ namespace Umbraco.Tests.Strings ShortStringHelperResolver.Reset(); } + [TestCase("alert('hello');", false)] + [TestCase("~/Test.js", true)] + [TestCase("../Test.js", true)] + [TestCase("/Test.js", true)] + [TestCase("Test.js", true)] + [TestCase("Test.js==", false)] + [TestCase("/Test.js function(){return true;}", false)] + public void Detect_Is_JavaScript_Path(string input, bool result) + { + var output = input.DetectIsJavaScriptPath(); + Assert.AreEqual(result, output.Success); + } + [TestCase("hello.txt", "hello")] [TestCase("this.is.a.Txt", "this.is.a")] [TestCase("this.is.not.a. Txt", "this.is.not.a. Txt")] diff --git a/src/Umbraco.Web.UI.Client/src/common/services/macro.service.js b/src/Umbraco.Web.UI.Client/src/common/services/macro.service.js index f36b932d5f..f0f1649bbe 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/macro.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/macro.service.js @@ -15,7 +15,7 @@ function macroService() { //This regex will match an alias of anything except characters that are quotes or new lines (for legacy reasons, when new macros are created // their aliases are cleaned an invalid chars are stripped) - var expression = /(<\?UMBRACO_MACRO(?:.+?)?macroAlias=["']([^\"\'\n\r]+?)["'][\s\S]+?)(\/>|>.*?<\/\?UMBRACO_MACRO>)/i; + var expression = /(<\?UMBRACO_MACRO (?:.+?)?macroAlias=["']([^\"\'\n\r]+?)["'][\s\S]+?)(\/>|>.*?<\/\?UMBRACO_MACRO>)/i; var match = expression.exec(syntax); if (!match || match.length < 3) { return null; diff --git a/src/Umbraco.Web.UI.Client/src/installer/installer.service.js b/src/Umbraco.Web.UI.Client/src/installer/installer.service.js index f2df5dea2b..970cf8da31 100644 --- a/src/Umbraco.Web.UI.Client/src/installer/installer.service.js +++ b/src/Umbraco.Web.UI.Client/src/installer/installer.service.js @@ -28,7 +28,7 @@ angular.module("umbraco.install").factory('installerService', function($rootScop 'Umbraco is the best of both worlds: 100% free and open source, and backed by a professional and profitable company', "There's a pretty big chance, you've visited a website powered by Umbraco today", "'Umbraco-spotting' is the game of spotting big brands running Umbraco", - "At least 3 people have the Umbraco logo tattooed on them", + "At least 4 people have the Umbraco logo tattooed on them", "'Umbraco' is the danish name for an allen key", "Umbraco has been around since 2005, that's a looong time in IT", "More than 400 people from all over the world meet each year in Denmark in June for our annual conference CodeGarden", diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index b54954007d..d704139e04 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -194,7 +194,7 @@