- Services/PdfRedactText.cs: strip text whose origin falls inside a CoverAnnotation from the page content stream at save time, hooked into PdfBurn.DrawAnnotationsIntoDoc. Fixes edited values staying recoverable by text extraction. - Themes/MMD.xaml replaces all thirteen themes; picker and accent strip removed; no dark mode. - Rename KillerPDF -> MMD PDF across code, resources, packaging and locale strings; new icon. - Remove the upstream author credit and the in-app install button.
24 lines
824 B
C#
24 lines
824 B
C#
using MmdPdf.Services;
|
|
using Xunit;
|
|
|
|
namespace MmdPdf.Tests;
|
|
|
|
public sealed class ProtocolRegistrarTests
|
|
{
|
|
[Fact]
|
|
public void ParsesEncodedHttpsPdfUrl()
|
|
{
|
|
Assert.True(ProtocolRegistrar.TryGetTargetUrl(
|
|
"mmdpdf://open?url=https%3A%2F%2Fexample.com%2Ffile.pdf%3Fx%3D1", out var target));
|
|
Assert.Equal("https://example.com/file.pdf?x=1", target!.AbsoluteUri);
|
|
}
|
|
|
|
[Theory]
|
|
[InlineData("mmdpdf://open?url=http%3A%2F%2Fexample.com%2Ffile.pdf")]
|
|
[InlineData("mmdpdf://open?url=file%3A%2F%2Fc%3A%2Fsecret.pdf")]
|
|
[InlineData("mmdpdf://wrong?url=https%3A%2F%2Fexample.com%2Ffile.pdf")]
|
|
[InlineData("https://example.com/file.pdf")]
|
|
public void RejectsUnsafeOrUnrelatedLaunches(string value)
|
|
=> Assert.False(ProtocolRegistrar.TryGetTargetUrl(value, out _));
|
|
}
|