PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Text with double slash raises exception in table? V1.5
https://forum.pdfsharp.net/viewtopic.php?f=3&t=4062
Page 1 of 1

Author:  HMuser [ Sun Nov 17, 2019 4:03 pm ]
Post subject:  Text with double slash raises exception in table? V1.5

Hi

I have been using Migradoc 1.32 and recently have been trying the stable version 1.5
I found that we got an error in 1.5 but not in 1.32. It seems to relate to table rendering when the table cell text contains a double forward slash

e.g.

//TEST//
It appears that in the DDL this sequence is seen as a "comment" in the function ReadCode() in DdlScanner.cs

else if (_currChar == '/' && _nextChar == '/')
{
// Token is comment. In code comments are ignored.
ScanSingleLineComment();
goto Again;
}

In 1.5 it generates an " End of file expected." Exception while 1.32 treats it as a comment

In 1.5 when the same text is not in a table it appears to be treated as comment and does not raise an exception so this seems to be related to tables which were modified significantly between1.32 and 1.50

I have captured the DDL in a file (about 33 Kb). Which I have attached as a zip.

Is there any way to "escape" the // in the text?

I have had a look on the forums but have also failed to identify anything to help me.

Is anyone able to offer advice? As I have to admit I have not been able to identify the issue so far.

I am using GDI build.
Using Both PDFSharp and Migradoc
full PDFsharp/MigraDoc source code from github being built under VS2017 and used within a VB.NET project
I originally have a C background from the mid 80's so can "read" the Migradoc code, but I am not a C++ or C# coder.

Thank you.

Attachments:
error.zip [2.06 KiB]
Downloaded 627 times

Author:  TH-Soft [ Mon Nov 18, 2019 12:02 am ]
Post subject:  Re: Text with double slash raises exception in table? V1.5

Hi!

As a workaround you can add a soft hyphen between the two slashes. Or maybe a zero-width joiner, a zero-width non-joiner or other "invisible" Unicode characters.

Any escaping should be done by the DLL writer, not in user code.

Author:  HMuser [ Tue Nov 19, 2019 3:25 pm ]
Post subject:  Re: Text with double slash raises exception in table? V1.5

Hi Thomas,

Thank you for this, I will implement a workaround in the data we supply to MigraDoc which will resolve it for now, hopefully a full resolution will appear at a later date.

Thanks

Steve

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/