mirror of
https://github.com/Stone-Red-Code/Markdowser.git
synced 2026-09-08 07:46:25 +02:00
Add Name and Description properties to IContentProcessor
This commit is contained in:
@@ -9,6 +9,10 @@ namespace Markdowser.Processing;
|
|||||||
|
|
||||||
internal interface IContentProcessor
|
internal interface IContentProcessor
|
||||||
{
|
{
|
||||||
|
string Name { get; }
|
||||||
|
|
||||||
|
string Description { get; }
|
||||||
|
|
||||||
bool CanProcess(HttpContentHeaders httpContentHeaders);
|
bool CanProcess(HttpContentHeaders httpContentHeaders);
|
||||||
|
|
||||||
Task<ContentViewModelBase> Process(HttpResponseMessage httpResponseMessage, IProgress<ProcessingProgress> progress);
|
Task<ContentViewModelBase> Process(HttpResponseMessage httpResponseMessage, IProgress<ProcessingProgress> progress);
|
||||||
|
|||||||
@@ -7,8 +7,13 @@ using System.Net.Http.Headers;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Markdowser.Processing.Processors;
|
namespace Markdowser.Processing.Processors;
|
||||||
|
|
||||||
internal class CommonImageProcessor : IContentProcessor
|
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)
|
public bool CanProcess(HttpContentHeaders httpContentHeaders)
|
||||||
{
|
{
|
||||||
if (httpContentHeaders.ContentType?.MediaType == "image/svg+xml")
|
if (httpContentHeaders.ContentType?.MediaType == "image/svg+xml")
|
||||||
|
|||||||
@@ -19,6 +19,10 @@ internal partial class HtmlProcessor : IContentProcessor
|
|||||||
{
|
{
|
||||||
private readonly ReverseMarkdown.Converter markdownConverter = new();
|
private readonly ReverseMarkdown.Converter markdownConverter = new();
|
||||||
|
|
||||||
|
public string Name => "HTML Processor";
|
||||||
|
|
||||||
|
public string Description => "Processes HTML content";
|
||||||
|
|
||||||
public HtmlProcessor()
|
public HtmlProcessor()
|
||||||
{
|
{
|
||||||
markdownConverter.Config.UnknownTags = ReverseMarkdown.Config.UnknownTagsOption.Bypass;
|
markdownConverter.Config.UnknownTags = ReverseMarkdown.Config.UnknownTagsOption.Bypass;
|
||||||
|
|||||||
Reference in New Issue
Block a user