[tracker/tracker-0.8] tracker-extract-html: Improve <script> bypassing.
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/tracker-0.8] tracker-extract-html: Improve <script> bypassing.
- Date: Thu, 22 Apr 2010 11:26:54 +0000 (UTC)
commit 347ff3b695988c3435a58fbf2a758c4c6eaad82b
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Apr 19 16:37:56 2010 +0200
tracker-extract-html: Improve <script> bypassing.
src/tracker-extract/tracker-extract-html.c | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-html.c b/src/tracker-extract/tracker-extract-html.c
index 7092411..55a9732 100644
--- a/src/tracker-extract/tracker-extract-html.c
+++ b/src/tracker-extract/tracker-extract-html.c
@@ -185,6 +185,19 @@ parser_start_element (void *data,
}
static void
+parser_end_element (void *data,
+ const xmlChar *name_)
+{
+ parser_data *pd = data;
+ const gchar *name = (const gchar*) name_;
+
+ if (g_ascii_strcasecmp (name, "title") == 0 ||
+ g_ascii_strcasecmp (name, "script") == 0) {
+ pd->current = -1;
+ }
+}
+
+static void
parser_characters (void *data,
const xmlChar *ch,
int len)
@@ -220,8 +233,6 @@ parser_characters (void *data,
}
break;
}
-
- pd->current = -1;
}
static void
@@ -249,7 +260,7 @@ extract_html (const gchar *uri,
NULL, /* startDocument */
NULL, /* endDocument */
parser_start_element, /* startElement */
- NULL, /* endElement */
+ parser_end_element, /* endElement */
NULL, /* reference */
parser_characters, /* characters */
NULL, /* ignorableWhitespace */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]