Add cancel-safe native Settings pages, configurable typography/CSS/themes, file registration and activation, theme-aware source and proportional layout, toolbar/footer/editor guidance and open-source credits. Preserve attributed Darin Kelkhoff document styles and literal passive rendering. Retain verbatim vendor notices with scoped newline/whitespace preservation; secret, security and other hooks remain enabled. Validation: zero-warning Release build, 582 core tests with 100% measured line coverage, 25 Windows adapter tests, formatting and self-contained publish pass. Current native/distributed acceptance and source-hover diagnosis remain pending; no production release-readiness claim. Refs #1, #6, #11, #14, #16, #17, #18, #19, #20, #21, #23, #24, #25, #26, #27, #28 Co-Authored-By: Codex (GPT-6) <noreply@openai.com> Signed-off-by: James Maes <jmaes@dmdbrands.com>
44 lines
1.5 KiB
C#
44 lines
1.5 KiB
C#
/*
|
|
* Copyright (c) 2026 James Maes
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
using Markdig.Extensions.EmphasisExtras;
|
|
|
|
|
|
namespace MarkdownViewr.Windows.Core.Documents;
|
|
|
|
/// <summary>Independent reference Markdown extensions, enabled by default without altering the literal source.</summary>
|
|
/// <param name="Highlight">Renders double-equals text as a passive mark.</param>
|
|
/// <param name="Superscript">Renders single-caret text above the baseline.</param>
|
|
/// <param name="Subscript">Renders single-tilde text below the baseline, leaving double-tilde strikethrough available.</param>
|
|
/// <param name="Underline">Renders double-plus text as inserted/underlined content.</param>
|
|
public sealed record MarkdownExtensions(bool Highlight = true, bool Superscript = true, bool Subscript = true, bool Underline = true)
|
|
{
|
|
/// <summary>GFM strikethrough remains available regardless of the four independent extension preferences.</summary>
|
|
internal EmphasisExtraOptions EmphasisOptions
|
|
{
|
|
get
|
|
{
|
|
EmphasisExtraOptions options = EmphasisExtraOptions.Strikethrough;
|
|
if(Highlight)
|
|
{
|
|
options |= EmphasisExtraOptions.Marked;
|
|
}
|
|
if(Superscript)
|
|
{
|
|
options |= EmphasisExtraOptions.Superscript;
|
|
}
|
|
if(Subscript)
|
|
{
|
|
options |= EmphasisExtraOptions.Subscript;
|
|
}
|
|
if(Underline)
|
|
{
|
|
options |= EmphasisExtraOptions.Inserted;
|
|
}
|
|
return options;
|
|
}
|
|
}
|
|
}
|