| Summary: | Invalid code in Markdown code fences breaks formatting outside of code fences | ||
|---|---|---|---|
| Product: | [Frameworks and Libraries] frameworks-syntax-highlighting | Reporter: | Dotan Cohen <kde-2011.08> |
| Component: | syntax | Assignee: | KWrite Developers <kwrite-bugs-null> |
| Status: | CONFIRMED --- | ||
| Severity: | normal | CC: | christoph, jpmbatrina01, kde-2011.08, kontakt, walter.von.entferndt |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Ubuntu | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: |
Kate 19.12.3 in Linuxmint showing correct highlighting
Good PHP code on the left, invalid PHP code on the right. SQL in a PHP block PHP with `?>` breaking Markdown fenced code block |
||
|
Description
Dotan Cohen
2021-09-05 08:40:33 UTC
Created attachment 141309 [details]
Kate 19.12.3 in Linuxmint showing correct highlighting
Thanks for the bug report!
I cannot reproduce the issue, neither with Kate from master nor with Kate 19.12.3 from a linuxmint 20.2 live usb.
I have attached a screenshot of how it looks on both versions (minus differences on the colors), and similar highlighting happens in VS Code and Notepad++.
Please attach a screenshot of the issue you described, even better if you point out the exact problem, so that we can check if it has already been fixed in newer versions.
setting to needsinfo Thank you Jan. Notice this additional step needed to make the PHP code invalid, and thus break the Kate formatting:
> 4. Remove one of the double quote characters from the string assignment line.
Screenshot in a few minutes.
Created attachment 141326 [details]
Good PHP code on the left, invalid PHP code on the right.
Note in the screenshot, the PHP code on the right is missing a double-quote character, making the code not valid PHP code. Ahh, my bad. I don't know how I didn't notice the 4th step before, but now I can confirm that the bug exists in kate master. Takes for the quick response, complete with comparison screenshots! Created attachment 141327 [details]
SQL in a PHP block
This is another example, in which valid SQL is mentioned in a PHP block. It breaks the formatting outside the code fences as well.
(In reply to Dotan Cohen from comment #7) > Created attachment 141327 [details] > SQL in a PHP block > > This is another example, in which valid SQL is mentioned in a PHP block. It > breaks the formatting outside the code fences as well. This one I can reproduce in Kate 19.12.3, but not anymore in the latest version from master. As for the original bug (the one with the unfinished string), that would be a bit tricky to fix as the php syntax-highlighting is "imported" wholesale, and current syntax rules dictate that a string in php will not end unless a closing " is supplied. It might take while for the bug to be fixed I see, thank you. Created attachment 185000 [details]
PHP with `?>` breaking Markdown fenced code block
I don't know if it's related or not, but when I write Markdown in Kate and put a fenced PHP code block, the closing fence is treated as a new opening fence if the fenced PHP code contains a `<?php […] ?>`.
I've attached a screenshot of how I discovered it.
|