mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-21 19:29:18 +00:00
Ignore fragment-only links.
We don't handle URLs with fragments exactly ;-) well - meaning we send the fragment part to the server and we don't display the document starting at the anchor tag. Instead of adding the missing capabilities and thus adding lots of code I instead opted to simply ignore fragment-only links. This approach is based on the practical knowledge that fragments are primarily used for intra-document navigation - and are as such fragment-only links. And as we ignore them anyway when displaying the document it's more ergonomic to not have those links in the first place.
This commit is contained in:
parent
9b9b92be06
commit
cdd289a7ff
@ -170,6 +170,7 @@ static struct inputattrib *currptr;
|
||||
|
||||
#define ISO_nl 0x0a
|
||||
#define ISO_space 0x20
|
||||
#define ISO_hash 0x23
|
||||
#define ISO_ampersand 0x26
|
||||
#define ISO_plus 0x2b
|
||||
#define ISO_slash 0x2f
|
||||
@ -886,7 +887,11 @@ htmlparser_word(char *word, unsigned char wordlen)
|
||||
void
|
||||
htmlparser_link(char *text, unsigned char textlen, char *url)
|
||||
{
|
||||
if(url[0] == ISO_hash) {
|
||||
htmlparser_word(text, textlen);
|
||||
} else {
|
||||
add_pagewidget(text, textlen, url, CTK_WIDGET_HYPERLINK, 0);
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
#if WWW_CONF_FORMS
|
||||
|
Loading…
Reference in New Issue
Block a user