User:Paxed/src geshi test
Jump to navigation
Jump to search
This is a test of tiny highlight-extension modification:
Done:
- Added lineid to the <syntaxhighlight>.
- Edited geshi.php to output the id without the dash before the number. (So line number hrefs are #line1234, to keep compatible with current ones)
TODO:
GeshiThe extension should not strip out empty lines at the end of the highlighting block.- nethack function url links? (need to add the nethack functions and a lookup url ($geshi->add_keyword(), $geshi->add_keyword_group()))
- Geshi only supports function name variable, eg. http://nethackwiki.com/wiki/SrcFunc:{FNAME}, when we need both the src filename and the function name.
- Des-file format? (tricky if we want to color both the syntax and the MAP characters)
- Could be solved by colorizing MAPs separate from other parts, or by using Geshi devel version.
/* Called in several places - may produce output */
/* eg ship_object() and dropy() -> sellobj() both produce output */
void
dropx(obj)
register struct obj *obj;
{
#ifndef GOLDOBJ
if (obj->oclass != COIN_CLASS || obj == invent) freeinv(obj);
#else
/* Ensure update when we drop gold objects */
if (obj->oclass == COIN_CLASS) flags.botl = 1;
freeinv(obj);
#endif
if (!u.uswallow) {
if (ship_object(obj, u.ux, u.uy, FALSE)) return;
if (IS_ALTAR(levl[u.ux][u.uy].typ))
doaltarobj(obj); /* set bknown */
}
dropy(obj);
}