public override bool Process(IElementListener listener)
{
try
{
bool localDestination = (reference != null && reference.StartsWith("#"));
bool notGotoOK = true;
foreach (Chunk chunk in this.Chunks)
{
if (name != null && notGotoOK && !chunk.IsEmpty())
{
chunk.SetLocalDestination(name);
notGotoOK = false;
}
if (localDestination)
{
chunk.SetLocalGoto(reference.Substring(1));
}
else if (reference != null)
chunk.SetAnchor(reference);
listener.Add(chunk);
}
return true;
}
catch (DocumentException)
{
return false;
}
}