Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table tag surrounded by PRE is not converted correctly #352

Open
thnbit opened this issue Jun 15, 2023 · 2 comments
Open

Table tag surrounded by PRE is not converted correctly #352

thnbit opened this issue Jun 15, 2023 · 2 comments

Comments

@thnbit
Copy link

thnbit commented Jun 15, 2023

Table tag surrounded by PRE with and without CODE tag is not converted correctly - See code and output below.
Same HTML code rendered by the browser shows the table just fine.

In my case, the HTML code is originating from another system where it displays as expected. I have no control over the creation of the code.
Can this issue be fixed? If not, are there any workarounds available?

string table_surrounded_by_pre_code = @"
    <pre>
        <code>
          <table style=""border-collapse:collapse; "">
            <tbody>
	      <tr>
		<td>name</td>
		<td>phone</td>
		<td>email</td>
	      </tr>
	      <tr>
		<td>John Doe</td>
		<td>202-918-2132</td>
		<td>[email protected]</td>
	      </tr>
	      <tr>
		<td>Jane Doe</td>
		<td>220-326-8196</td>
		<td>[email protected]</td>
	      </tr>
	      <tr>
            </tbody>
          </table>
        </code>
    </pre>";

string result = converter.Convert(table_surrounded_by_pre_code);
Console.WriteLine(result);

-->

name
                                                    phone
                                                    email


                                                    John Doe
                                                    202-918-2132
                                                    [email protected]


                                                    Jane Doe
                                                    220-326-8196
                                                    [email protected]

@mysticmind
Copy link
Owner

@thnbit acknowledge seeing this issue, will check and revert to you.

@mysticmind
Copy link
Owner

mysticmind commented Jul 4, 2023

@thnbit For the combination of code tag wrapped in pre tag, may be we can put the whole table content "as is". But for just pre tag, there are couple of options 1)pass the content "as is" 2)run the existing logic. Please confirm what you are thinking, will look at an appropriate fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants