https://bugs.kde.org/show_bug.cgi?id=468484

--- Comment #3 from Richard Neill <k...@richardneill.org> ---
Hi - and thanks for your reply. 
I've realised what's happening - there is an issue here, but it's not quite
what I thought it was.

Test case 1. 
Create a file with a .php extension, and (without entering php mode, with
<?php), just have this line:

--- BEGIN ---
<h5>This is a non&eacute;breakzing title <a
href='http://examplze.com/'>link</a> </h5>
--- END ---

This is handled correctly, identifying the misspelled 'breakzing' but nothing
else. 


Test case 2.
In the same file, enter PHP mode and echo it.

--- BEGIN ---
<?php 
echo "<h5>This is a non&nbsp;breakzing title with a $var[keytzypo] embedded and
a <a href='http://examplze.com/'>link</a> </h5>";
?>
--- END ---

In this case, the spellchecker triggers on:
*  h5  - this is a legal tag
*  nbsp - this is a legal entity
*  breakzing - this IS a typo which we wanted to find - correct behaviour.
*  keytzypo - this is an array-key - shouldn't trigger. (normal, non-array
variables are OK).
 * examplze - part of an URL, shouldn't trigger.
* h5 - again.


=> So, this bug report should really be about checking, when it is within a
quoted-string in PHP. 

This way of writing code is so common (i.e. switching in and out of PHP-mode by
using echo, rather than with ?>...<php)  that I didn't notice the echo was a
critical part of the bug-report - and KWrite's normal helpful behaviour of
highlighting multiple instances of the same string meant that, when it
highlighted the h5 within the echo, it also highlights the one in the normal
html, which may be why I didn't. My error - sorry. 

* The behaviour is the same in KWrite and in Kate (as we would expect).

* The same behaviour occurs for any way of quoting a string: single, double, or
heredoc.

* A minor unrelated point I spotted: in HTML mode, Kate/KWrite correctly
ignores everything in a tag. But perhaps it should check title and alt
attributes.

Thanks for your help.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to