+ // We have a valid tag, add it to the cache.
+ size_t tg = Cache().size();
+ Cache().push_back(wxHtmlCacheItem());
+ Cache()[tg].Key = stpos;
+ Cache()[tg].Name = new wxChar[i+1];
+ memcpy(Cache()[tg].Name, tagBuffer, (i+1)*sizeof(wxChar));
+
+ if ((stpos+1) < end && *(stpos+1) == wxT('/')) // ending tag:
+ {
+ Cache()[tg].type = wxHtmlCacheItem::Type_EndingTag;
+ // find matching begin tag:
+ for (i = tg; i >= 0; i--)