By raindrop on
Hi all,
I've got some hyperlinks in the same page as a test, and they are as follows:
example.com
and then using a tag:
<a href=''></a>
Some are with single quotes, some double but all turn out using single quotations.
The problem is not the quotes, but rather example.com is interpreted as being a URI in my site, when obviously it is not.
Is this how drupal is meant to work?
Thank you
Edited by WorldFallz - added <code> tags.
Comments
=-=
inspect the filters enabled on the input format in use. I believe there is a filter that controls what you are seeing.
Thanks. I tried that. Maybe I
Thanks.
I tried that.
Maybe I am being misunderstood (no pun intended) :)
This is what I have entered:
http://www.example.com
www.example.com
example.com
example1
example2
This is the resulting code:
http://www.example.com
www.example.com
example.com
example1
example2
When I click on one of the bottom two links, it puts my domain in front of it, eg drupal/node/example.com
Regards
=-=
drupal is installed in subdirectory?
did you enable the rewrite in .htaccess?
or set a $base_url in settings.php?
as seen in your examples drupal doesn't auto write a href on anything that doesn't include a www. or a http://
That said, and if i understand the issue correctly, what other modules are installed that may alter or add to the filter system?
Drupal is in a sub directory,
Drupal is in a sub directory, rewrite .htaccess is enabled in sites/default.
What it did was it appended in the last two examples onto the end of my domain and subsequent drupal directory.
Thanks for helping.
Why did you do that, and what did you expect?
<a href="example.com">example1</a>(which is what you entered - please use CODE tags if you are trying to illustrate this)
... is really badly incorrect. So don't do that then.
It's not Drupal munging those links for you, it's your (and every) browser. All correct browsers will interpret
<a href="example.com">example1</a>as<a href="{local page URL}/example.com">example1</a>View-source will help you figure out what's really happening.
This is normal HTML link resolution, you'd get it in static HTML, or any editor you messed with like that.
.dan. is the New Zealand Drupal Developer working on Government Web Standards
http://www.example.com www.ex
http://www.example.com
www.example.com
example.com
example1
example2
Ok, I understand maybe just
Ok, I understand maybe just writing something.com won't produce a link but the last two examples, why are they in the drupal.org domain?
see above
See the place where I put
{local page URL}?relative links
Inside an href, there is no difference between
a href="example.com"and ahref="example.htm"dot-com is not a magic word that suddenly makes a string into a website.
That magic word is
http://Outside of code - in plain text, the URL-filter is guessing that
example.comprobably should be a link. But if you are writing HTML code yourself, the filter assumes (in this case wrongly) that you know what you are doing, and leaves your code alone..dan. is the New Zealand Drupal Developer working on Government Web Standards
Hi, I am writing < a href =
Hi,
I am writing < a href = 'example.com' > example < / a >
(with no spaces), and still the system thinks I am talking about a link relative to Drupal but I'm not.
DOT.COM may not be magic but Drupal certainly should not need to try and be so, meaning it should not prep-end anything to the start of what is defined as a link, if it is in any way a "serious" Content Management System. In this case I don't think it has anything to do with the browser in actual fact especially when you consider standards such as XMLBase.
So thanks.
Standards - that word does not mean what you think it means
You keep making off-hand comments about "standards" when you don't know what the standards are yourself. This behaviour is standard cannonic HTML, XHTML, and even the normal behaviour for other XML-type variations.
You seem to not even know what XMLBase is for, as it doesn't apply in this case.
It's not Drupal doing this to you. It's your browser behaving the way you explicitly told it to. It is what you'd get even with a static HTML file.
view source and you will see that Drupal hasn't messed with your code on those examples. It is not prepending anything. It's your browser interpreting the instructions you gave it.
An href with no absolute URI means it's a local link. Always.
What you are putting in there is bad code. It's GIGO.
If you choose to write bad code, the system leaves it alone, and you get what you get. The function that converts plaintext strings that look like host names is an optional extra, enabled by default to assist non-coders get what they have come to expect. Even this link conversion is a deviation from what we could call a 'standard' for text input. But it's a handy and harmless convention, so it's there for folk to use.
It's possible to add a filter that would give you the non-standard behaviour you desire, but that could cause unexpected side-effects. So it's not something that would be enabled normally.
.dan. is the New Zealand Drupal Developer working on Government Web Standards
Without getting
Without getting personal.
I've viewed the code, and the CMS has generated a relative link from what I entered into the create content page, which is not desired behaviour IMV and has nothing at all to do with the browser.
_
Personal has nothing to do with it-- you're wrong, period. If you don't specify an absolute URI (with http://) you get a relative one. period. There's page and pages and pages of this on google. Blustering on and on when you clearly don't know what you're talking about just makes you look foolish.
Well regardless, I am
Well regardless, I am entering information into an information system and I'd prefer it if it was a bit smarter in some areas.
I like Drupal don't get me wrong it's good at what it does but needs to do more unless there is some kind of module.
I'd prefer it if ... was a bit smarter
Then what you have is a feature request, not a standards error.
In your case, it could be that that feature request is reasonable for your use-case. If you are used to this behaviour from another CMS (which one?) it may be worth looking into, but to the current stock of web developers, this request has never come up before.
I'm not keen on it, but that's because I know HTML. I'd see this as a step back because it teaches newbies incorrect behaviour and invalid code. This hack would create a non-transferrable skill.
Why not just turn on a WYSIWYG that will protect you from this issue?
.dan. is the New Zealand Drupal Developer working on Government Web Standards
=-=
Drupal to be smarter? How?
How would you prefer drupal to deal with the difference between relative and absolute paths?
:-B
By mind reading.
"Do what I want, not what I say"
That'll be Drupal 8
;-)
.dan. is the New Zealand Drupal Developer working on Government Web Standards
.com isn't a file, so why let
.com isn't a file, so why let the browser have any role unless of course we are talking xml, which by the looks of this system may not be available, par the future as it might be.
Anyway, I simply thought that instead of saying www. or http:// that if you said nothing it would not leave it to chance what might happen but would instead create a link, since after all it's supposed to be able to replace HTML editing programs altogether, at least in my mind.
Regards anyway.
Standards FTW
It's the opposite of "by chance". It's a Very clearly specified behaviour, consistent across ALL systems ever. Take it up with Sir Tim if you think you know better.
The R in URL means "Resource". Whether it's a "file" or not is totally implementation-dependent. See section 3 of the standard. Absolutely no Drupal URLs are files when you look at it! Nor most other modern CMS sites.
If the system auto-converts a simple mention of the file command.com into a link, then that is a mistake, brought about by people making naive assumptions and not following the spec :-)
... Lets see if Drupal makes that mistake...
... nope? Yay for real standards.
.dan. is the New Zealand Drupal Developer working on Government Web Standards