diff --git a/common/ASC.Notify.Textile/JabberStyler.cs b/common/ASC.Notify.Textile/JabberStyler.cs index 7f07fd016f..e9226fb5d7 100644 --- a/common/ASC.Notify.Textile/JabberStyler.cs +++ b/common/ASC.Notify.Textile/JabberStyler.cs @@ -28,13 +28,36 @@ namespace ASC.Notify.Textile [Scope] public class JabberStyler : IPatternStyler { - private static readonly Regex _velocityArguments = new Regex(NVelocityPatternFormatter.NoStylePreffix + "(?.*?)" + NVelocityPatternFormatter.NoStyleSuffix, RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.Compiled); - private static readonly Regex _linkReplacer = new Regex(@"""(?[\w\W]+?)"":""(?[^""]+)""", RegexOptions.Singleline | RegexOptions.Compiled); - private static readonly Regex _textileReplacer = new Regex(@"(h1\.|h2\.|\*|h3\.|\^)", RegexOptions.Singleline | RegexOptions.Compiled); - private static readonly Regex _brReplacer = new Regex(@"", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled | RegexOptions.Singleline); - private static readonly Regex _closedTagsReplacer = new Regex(@"", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled | RegexOptions.Singleline); - private static readonly Regex _tagReplacer = new Regex(@"<(.|\n)*?>", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled | RegexOptions.Singleline); - private static readonly Regex _multiLineBreaksReplacer = new Regex(@"(?:\r\n|\r(?!\n)|(?!<\r)\n){3,}", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant); + private static readonly Regex _velocityArguments + = new Regex(NVelocityPatternFormatter.NoStylePreffix + "(?.*?)" + NVelocityPatternFormatter.NoStyleSuffix, + RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.Compiled); + + private static readonly Regex _linkReplacer + = new Regex(@"""(?[\w\W]+?)"":""(?[^""]+)""", + RegexOptions.Singleline | RegexOptions.Compiled); + + private static readonly Regex _textileReplacer + = new Regex(@"(h1\.|h2\.|\*|h3\.|\^)", + RegexOptions.Singleline | RegexOptions.Compiled); + + private static readonly Regex _brReplacer + = new Regex(@"", + RegexOptions.IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled | RegexOptions.Singleline); + + private static readonly Regex _closedTagsReplacer + = new Regex(@"", + RegexOptions.IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled | RegexOptions.Singleline); + + private static readonly Regex _tagReplacer + = new Regex(@"<(.|\n)*?>", + RegexOptions.IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled | RegexOptions.Singleline); + + private static readonly Regex _multiLineBreaksReplacer + = new Regex(@"(?:\r\n|\r(?!\n)|(?!<\r)\n){3,}", + RegexOptions.IgnoreCase | RegexOptions.CultureInvariant); public void ApplyFormating(NoticeMessage message) { diff --git a/common/ASC.Notify.Textile/PushStyler.cs b/common/ASC.Notify.Textile/PushStyler.cs index 10c0305cfd..e1d53f483f 100644 --- a/common/ASC.Notify.Textile/PushStyler.cs +++ b/common/ASC.Notify.Textile/PushStyler.cs @@ -28,7 +28,9 @@ namespace ASC.Notify.Textile [Scope] public class PushStyler : IPatternStyler { - private static readonly Regex _velocityArgumentsRegex = new Regex(NVelocityPatternFormatter.NoStylePreffix + "(?'arg'.*?)" + NVelocityPatternFormatter.NoStyleSuffix, RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.Compiled); + private static readonly Regex _velocityArgumentsRegex + = new Regex(NVelocityPatternFormatter.NoStylePreffix + "(?'arg'.*?)" + NVelocityPatternFormatter.NoStyleSuffix, + RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.Compiled); public void ApplyFormating(NoticeMessage message) { diff --git a/common/ASC.Notify.Textile/TextileStyler.cs b/common/ASC.Notify.Textile/TextileStyler.cs index fb9373928a..fddc8b2f55 100644 --- a/common/ASC.Notify.Textile/TextileStyler.cs +++ b/common/ASC.Notify.Textile/TextileStyler.cs @@ -28,7 +28,9 @@ namespace ASC.Notify.Textile [Scope] public class TextileStyler : IPatternStyler { - private static readonly Regex _velocityArguments = new Regex(NVelocityPatternFormatter.NoStylePreffix + "(?.*?)" + NVelocityPatternFormatter.NoStyleSuffix, RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.Compiled); + private static readonly Regex _velocityArguments + = new Regex(NVelocityPatternFormatter.NoStylePreffix + "(?.*?)" + NVelocityPatternFormatter.NoStyleSuffix, + RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.Compiled); private readonly CoreBaseSettings _coreBaseSettings; private readonly IConfiguration _configuration;