static struct kw * isopentag(Line *p) { int i=0, len; char *line; if ( !p ) return 0; line = T(p->text); len = S(p->text); if ( len < 3 || line[0] != '<' ) return 0; if ( line[1] == '!' && line[2] == '-' && line[3] == '-' ) /* comments need special case handling, because * the !-- doesn't need to end in a whitespace */ return &comment; /* find how long the tag is so we can check to see if * it's a block-level tag */ for ( i=1; i < len && T(p->text)[i] != '>' && T(p->text)[i] != '/' && !isspace(T(p->text)[i]); ++i ) ; return mkd_search_tags(T(p->text)+1, i-1); }
/* define an additional html block tag */ void mkd_define_tag(char *id, int selfclose) { struct kw *p; /* only add the new tag if it doesn't exist in * either the standard or extra tag tables. */ if ( !(p = mkd_search_tags(id, strlen(id))) ) { p = &EXPAND(extratags); p->id = id; p->size = strlen(id); p->selfclose = selfclose; } }