Browse Source
Merge pull request #13739 from abpframework/auto-merge/rel-6-0/1289
Merge branch dev with rel-6.0
pull/13753/head
Enis Necipoglu
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
6 additions and
6 deletions
-
modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Contents/ContentParser.cs
-
modules/cms-kit/src/Volo.CmsKit.Common.Web/Renderers/MarkdownToHtmlRenderer.cs
|
|
|
@ -20,11 +20,11 @@ public class ContentParser : ITransientDependency |
|
|
|
|
|
|
|
public Task<List<ContentFragment>> ParseAsync(string content) |
|
|
|
{ |
|
|
|
if (!_options.WidgetConfigs.Any()) |
|
|
|
if (!_options.WidgetConfigs.Any() || content is null) |
|
|
|
{ |
|
|
|
return Task.FromResult(new List<ContentFragment> |
|
|
|
{ |
|
|
|
new ContentFragment { Type = Markdown }.SetProperty(Content, content), |
|
|
|
new ContentFragment { Type = Markdown }.SetProperty(Content, content ?? string.Empty), |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -1,11 +1,11 @@ |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Linq; |
|
|
|
using System.Text.RegularExpressions; |
|
|
|
using Markdig; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using System.Web; |
|
|
|
using Volo.Abp.DependencyInjection; |
|
|
|
using Ganss.XSS; |
|
|
|
using Markdig; |
|
|
|
using Volo.Abp.DependencyInjection; |
|
|
|
|
|
|
|
namespace Volo.CmsKit.Web.Renderers; |
|
|
|
|
|
|
|
@ -20,7 +20,7 @@ public class MarkdownToHtmlRenderer : IMarkdownToHtmlRenderer, ITransientDepende |
|
|
|
_htmlSanitizer = new HtmlSanitizer(); |
|
|
|
} |
|
|
|
|
|
|
|
public async Task<string> RenderAsync(string rawMarkdown, bool allowHtmlTags = true, bool preventXSS = true) |
|
|
|
public Task<string> RenderAsync(string rawMarkdown, bool allowHtmlTags = true, bool preventXSS = true) |
|
|
|
{ |
|
|
|
if (!allowHtmlTags) |
|
|
|
{ |
|
|
|
@ -34,7 +34,7 @@ public class MarkdownToHtmlRenderer : IMarkdownToHtmlRenderer, ITransientDepende |
|
|
|
html = _htmlSanitizer.Sanitize(html); |
|
|
|
} |
|
|
|
|
|
|
|
return html; |
|
|
|
return Task.FromResult(html); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|