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

Problems with multiline code blocks highlighted incorrectly #526

Closed
aivarsi opened this issue Feb 29, 2024 · 1 comment
Closed

Problems with multiline code blocks highlighted incorrectly #526

aivarsi opened this issue Feb 29, 2024 · 1 comment

Comments

@aivarsi
Copy link

aivarsi commented Feb 29, 2024

Describe the problem:

When code contains multi-line blocks, e.g. multi-line comments, only the first line is highlighted correctly but the rest are not.

Steps to reproduce:

Using your diff2html Online Demo, open any pull that contains multi-line comments e.g.
https://diff2html.xyz/demo.html?matching=none&matchWordsThreshold=0.25&maxLineLengthHighlight=10000&diffStyle=word&colorScheme=light&renderNothingWhenEmpty=0&matchingMaxComparisons=2500&maxLineSizeInBlockForComparison=200&outputFormat=line-by-line&drawFileList=1&synchronisedScroll=1&highlight=1&fileListToggle=1&fileListStartVisible=0&highlightLanguages=[object%20Map]&smartSelection=1&fileContentToggle=1&stickyFileHeaders=1&diff=https://github.com/Automattic/themes/pull/7664

There is this comment block:

/**
 * Title: Hidden No Results Content
 * Slug: lettre/hidden-no-results-content
 * Inserter: no
 */

We can observe that the first line is highlighted as comment but the others are not.

@rtfpessoa
Copy link
Owner

The highlight of the code is mostly a best effort since we only have parts of the code it is hard to get a precise without the full file.
If you have suggestions on how to fix it I am open to hear it, but for now this is the best we can do.

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