On Tue, Apr 23, 2013 at 10:23 AM, Gribnif <[email protected]> wrote:

> A well-formed href attribute has no spaces around the "="

My actual code has no spaces there. I guess I added them to the "faux code"
I used in the example here to make it look a little clearer. My mistake.

> and has quotes (single or double) around the URL...

Of course. My PHP script was adding the quotes.

> So, if you instead try this:
<a href="<?php createURL('myKeyword') ?>"> Lots of link text, image code,
etc. here </a>
> it validates successfully.

Not in my BBEdit, it doesn't. I commented out my code and copy/pasted in
your code instead. Then I invoked the code checker. It gave me this error
message:

Value of attribute “href” for element “<a>” is invalid; URL path needs
encoding (“%3C?php%20createURL('myKeyword')%20?%3E”).

I'm willing to make little changes like putting the quotation marks into
the original HTML instead of via the PHP, etc., but only if I can achieve
the goal of getting the BBEdit checker to validate the result.


On Tue, Apr 23, 2013 at 10:23 AM, Gribnif <[email protected]> wrote:

>
>
> On Monday, April 22, 2013 3:16:26 PM UTC-4, San wrote:
>>
>> However, in some constructions involving apparently nested angle brackets
>> < < >, I'm having a small problem with BBEdit warning of what I call "faux
>> errors."  For example, I might have code like this in my HTML page:
>>
>> <a href = <?php createURL("myKeyword") ?> > Lots of link text, image
>> code, etc. here </a>
>>
>> ...and invoking BBEdit's validator on the HTML page will result in two
>> errors:
>>
>> Error: File foobar.html, line 167:
>>     Unencoded entity found; “<” needs to be encoded as “&lt;”.
>> Error: File foobar.html, line 167:
>>     Close element “</a>” found but element wasn't open.
>>
>> It's perfectly understandable why BBEdit sees these as HTML errors, but
>> in fact once the PHP is done processing the page, the resultant HTML will
>> be well-formed with a valid link.
>>
>
> Actually, no. The result is not, strictly speaking, well-formed. A
> well-formed href attribute has no spaces around the "=" and has quotes
> (single or double) around the URL. So, if you instead try this:
>
> <a href="<?php createURL('myKeyword') ?>"> Lots of link text, image code,
> etc. here </a>
>
> it validates successfully. Of course, there will always be ways you can
> trip up BBEdit's validation by inserting PHP code, but in this case there
> is a workaround, which happens to produce HTML that is more valid anyway.
>
> --
> --
> You received this message because you are subscribed to the
> "BBEdit Talk" discussion group on Google Groups.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> <http://groups.google.com/group/bbedit?hl=en>
> If you have a feature request or would like to report a problem,
> please email "[email protected]" rather than posting to the group.
> Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
>
> ---
> You received this message because you are subscribed to the Google Groups
> "BBEdit Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem, 
please email "[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to