1
0
Fork 0

fix(converters): fix HtmlProvider WebView2 thread crash and add MarkdownProvider for pure .NET conversions

This commit is contained in:
Yun Chan 2026-09-08 04:16:48 +09:00
parent 63d50c165d
commit 4e5285e27c
7 changed files with 447 additions and 28 deletions

View file

@ -17,17 +17,22 @@ namespace Everything2Everything.Core.Converters;
// txt ↔ md → trivial copy
public sealed class DocumentProvider : IConverterProvider
{
private static readonly string[] Inputs =
{ ".html", ".htm", ".hwp", ".hwpx", ".docx", ".doc", ".md", ".markdown", ".txt" };
private static readonly string[] Outputs = { ".html", ".docx", ".md", ".txt" };
private static readonly string[] OfficeInputs = { ".docx", ".doc", ".hwp", ".hwpx" };
private static readonly string[] OfficeOutputs = { ".html", ".docx", ".md", ".txt" };
private static readonly string[] TextInputsToDocx = { ".html", ".htm", ".md", ".markdown", ".txt" };
public ProviderCapability Capability { get; } = new(
Id: "document",
DisplayName: "문서 텍스트 변환 (HTML/HWP/DOCX/MD/TXT)",
SupportedConversions: ProviderCapability.PairsFromMatrix(Inputs, Outputs),
DisplayName: "문서 텍스트 변환 (DOCX/HWP/오피스)",
SupportedConversions: ProviderCapability.PairsFromMatrix(OfficeInputs, OfficeOutputs)
.Concat(ProviderCapability.PairsFromMatrix(TextInputsToDocx, new[] { ".docx" }))
.Concat(new[]
{
new ConversionPair(".html", ".txt", LossClass.Recode),
new ConversionPair(".htm", ".txt", LossClass.Recode),
}).ToList(),
Status: ProviderStatus.RequiresExternal,
Summary: "HTML·HWP·DOCX·Markdown·TXT 사이의 양방향 텍스트 변환 (LibreOffice + Markdig + ReverseMarkdown).",
Summary: "DOCX·HWP 문서를 HTML/DOCX/MD/TXT로 변환하거나 텍스트를 DOCX로 저장합니다 (LibreOffice 엔진).",
ExternalDependencies: new[]
{
new ExternalDependency(