mirror of
https://github.com/Stone-Red-Code/Markdowser.git
synced 2026-09-04 09:06:15 +02:00
Add Name and Description properties to IContentProcessor
This commit is contained in:
@@ -9,6 +9,10 @@ namespace Markdowser.Processing;
|
||||
|
||||
internal interface IContentProcessor
|
||||
{
|
||||
string Name { get; }
|
||||
|
||||
string Description { get; }
|
||||
|
||||
bool CanProcess(HttpContentHeaders httpContentHeaders);
|
||||
|
||||
Task<ContentViewModelBase> Process(HttpResponseMessage httpResponseMessage, IProgress<ProcessingProgress> progress);
|
||||
|
||||
@@ -7,8 +7,13 @@ using System.Net.Http.Headers;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Markdowser.Processing.Processors;
|
||||
|
||||
internal class CommonImageProcessor : IContentProcessor
|
||||
{
|
||||
public string Name => "Common Image Processor";
|
||||
|
||||
public string Description => "Processes common image types (e.g. PNG, JPEG, GIF)";
|
||||
|
||||
public bool CanProcess(HttpContentHeaders httpContentHeaders)
|
||||
{
|
||||
if (httpContentHeaders.ContentType?.MediaType == "image/svg+xml")
|
||||
@@ -23,4 +28,4 @@ internal class CommonImageProcessor : IContentProcessor
|
||||
{
|
||||
return new CommonImageContentViewModel(httpResponseMessage.RequestMessage?.RequestUri?.Host?.ToString() ?? "Image", await httpResponseMessage.Content.ReadAsStreamAsync());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,10 @@ internal partial class HtmlProcessor : IContentProcessor
|
||||
{
|
||||
private readonly ReverseMarkdown.Converter markdownConverter = new();
|
||||
|
||||
public string Name => "HTML Processor";
|
||||
|
||||
public string Description => "Processes HTML content";
|
||||
|
||||
public HtmlProcessor()
|
||||
{
|
||||
markdownConverter.Config.UnknownTags = ReverseMarkdown.Config.UnknownTagsOption.Bypass;
|
||||
|
||||
Reference in New Issue
Block a user