Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/UglyToad.PdfPig.Tests/Integration/GithubIssuesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@

public class GithubIssuesTests
{
[Fact]
public void Issues1332()
{
var path = IntegrationHelpers.GetSpecificTestDocumentPath("color_icc_based.pdf");
using (var document = PdfDocument.Open(path, new ParsingOptions() { UseLenientParsing = true }))
{
var page = document.GetPage(1);
Assert.NotNull(page);
Assert.NotEmpty(page.Paths);
}
}

[Fact]
public void Issues1328()
{
Expand All @@ -29,7 +41,7 @@ public void Issues1328()
Assert.Equal(187334, images2[0].RawBytes.Length);
}
}

[Fact]
public void Issues1237()
{
Expand Down
Binary file not shown.
8 changes: 4 additions & 4 deletions src/UglyToad.PdfPig.Tokenization/PlainTokenizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

internal sealed class PlainTokenizer : ITokenizer
{
public bool ReadsNextByte { get; } = true;
public bool ReadsNextByte => true;

public bool TryTokenize(byte currentByte, IInputBytes inputBytes, out IToken token)
{
Expand All @@ -20,20 +20,20 @@ public bool TryTokenize(byte currentByte, IInputBytes inputBytes, out IToken tok
using var builder = new ValueStringBuilder(stackalloc char[16]);

builder.Append((char)currentByte);

while (inputBytes.MoveNext())
{
if (ReadHelper.IsWhitespace(inputBytes.CurrentByte))
{
break;
}

if (inputBytes.CurrentByte is (byte)'<' or (byte)'[' or (byte)'/' or (byte)']' or (byte)'>' or (byte)'(' or (byte)')')
if (inputBytes.CurrentByte is (byte)'<' or (byte)'[' or (byte)'/' or (byte)']' or (byte)'>' or (byte)'(' or (byte)')' or (byte)'%')
{
break;
}

builder.Append((char) inputBytes.CurrentByte);
builder.Append((char)inputBytes.CurrentByte);
}

var text = builder.AsSpan();
Expand Down
Loading