diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2008-10-26 20:34:47 +0100 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2008-10-26 20:34:47 +0100 |
commit | 54215bccc9abe648593e29b11878552be69fd835 (patch) | |
tree | 468211d6e69b8e5423935748f18652c178e40a95 /src/html.cc | |
parent | 1b864d4d57d1c193bff13485fc8647fe8af8807e (diff) |
add klass parameter
Diffstat (limited to 'src/html.cc')
-rw-r--r-- | src/html.cc | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/html.cc b/src/html.cc index 7fd53227..391abfdb 100644 --- a/src/html.cc +++ b/src/html.cc @@ -3445,7 +3445,7 @@ static void Html_process_tag(DilloHtml *html, char *tag, int tagsize) { int ci, ni; /* current and new tag indexes */ const char *attrbuf; - char *id = NULL, *style = NULL; + char *id = NULL, *klass = NULL, *style = NULL; char *start = tag + 1; /* discard the '<' */ int IsCloseTag = (*start == '/'); @@ -3515,6 +3515,13 @@ static void Html_process_tag(DilloHtml *html, char *tag, int tagsize) html->NameVal = NULL; } + if (tagsize >= 10) { /* length of "<t class=i>" */ + attrbuf = Html_get_attr2(html, tag, tagsize, "class", + HTML_LeftTrim | HTML_RightTrim); + if (attrbuf) + klass = strdup (attrbuf); + } + if (tagsize >= 11) { /* length of "<t style=i>" */ attrbuf = Html_get_attr2(html, tag, tagsize, "style", HTML_LeftTrim | HTML_RightTrim); @@ -3522,10 +3529,13 @@ static void Html_process_tag(DilloHtml *html, char *tag, int tagsize) style = strdup (attrbuf); } - html->styleEngine->startElement (ni, id, style); + + html->styleEngine->startElement (ni, id, klass, style); if (id) free (id); + if (klass) + free (klass); if (style) free (style); |