Skip to content
Snippets Groups Projects
Commit f51ffdcf authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

Removed duplicate link-case.

Rev: tutorial/html.pike:1.12
parent 0ad754bb
Branches
Tags
No related merge requests found
...@@ -316,22 +316,28 @@ SGML convert(SGML data) ...@@ -316,22 +316,28 @@ SGML convert(SGML data)
})+data->data+ ({ "\n" })); })+data->data+ ({ "\n" }));
continue; continue;
case "link": case "link":
{ {
data->tag="a"; data->tag="a";
string to=data->params->to; string to=data->params->to;
m_delete(data->params,"to"); m_delete(data->params,"to");
if(!link_to_page[to]) if(!link_to_page[to])
{ {
werror("Warning: Cannot find link "+to+" (near "+data->location()+")\n"); string s=(to/".")[-1];
ret+=data->data; if (link_to_page[s])
continue; to=s;
}else{ else
{
werror("Warning: Cannot find link "+to
+" (near "+data->location()+")\n");
data->tag="anchor";
break;
}
}
data->params->href=mklinkname(link_to_page[to])+"#"+to; data->params->href=mklinkname(link_to_page[to])+"#"+to;
break; break;
} }
}
case "arguments": case "arguments":
ret+=convert(({ ret+=convert(({
Sgml.Tag( Sgml.Tag(
...@@ -360,28 +366,6 @@ SGML convert(SGML data) ...@@ -360,28 +366,6 @@ SGML convert(SGML data)
Sgml.Tag("br")})); Sgml.Tag("br")}));
continue; continue;
case "link":
{
data->tag="a";
string to=data->params->to;
m_delete(data->params,"to");
if(!link_to_page[to])
{
string s=(to/".")[-1];
if (link_to_page[s])
to=s;
else
{
werror("Warning: Cannot find link "+to
+" (near "+data->location()+")\n");
data->tag="anchor";
break;
}
}
data->params->href=mklinkname(link_to_page[to])+"#"+to;
break;
}
case "ref": case "ref":
{ {
string to=data->params->to; string to=data->params->to;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment