K
K
king5552012-08-13 21:43:18
HTML
king555, 2012-08-13 21:43:18

Are links like href=" correct? ya.ru "?

I am making a service that checks the site for various errors, including searching for broken links.
On sites, sometimes there are tags of the form,
<img src=" /upload/medialibrary/123.jpg "/> i.e. with spaces at the beginning and / or at the end.

The automatic script finds an error, but browsers display it correctly, including something like <a href=" http://ya.ru/upload/medialibrary/a49/De Dietrich DOP895 B_1.jpg ">1</a> .

The question is, is it necessary to flag such things as errors, or is it enough to quietly trim the spaces from the ends and not tell anyone?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
avalak, 2012-08-13
@avalak

Um, such a question (about attributes in html) has already been ( answered ).
Check the standard...

J
jorikburlakov, 2012-08-13
@jorikburlakov

It seems to me that now every browser will perceive normally such links. The browser first tries to open the page according to the standard specified in the DOCTYPE, if it does not find it, it displays it as it considers it correct.

L
LeoCcoder, 2012-08-13
@LeoCcoder

as already said, the urls are quite correct, but the situation is not quite usual ... why put spaces inside the quotes on purpose?
you can show varning, there are no errors, but it would be nice to remove the spaces, if only to make the code more readable.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question