PyObject *__pyx_arg_break_character;
};
-/* "lxml/html/clean.py":491
+/* "lxml/html/clean.py":496
* return False
*
* def kill_conditional_comments(self, doc): # <<<<<<<<<<<<<<
static const char __pyx_k__12[] = "\\";
static const char __pyx_k__15[] = ".";
static const char __pyx_k__16[] = ",";
-static const char __pyx_k__41[] = "/\\*.*?\\*/";
+static const char __pyx_k__42[] = "/\\*.*?\\*/";
static const char __pyx_k_a_z[] = "[^a-z]";
static const char __pyx_k_all[] = "__all__";
static const char __pyx_k_bad[] = "bad";
static const char __pyx_k_set[] = "set";
static const char __pyx_k_src[] = "src";
static const char __pyx_k_sub[] = "sub";
+static const char __pyx_k_sys[] = "sys";
static const char __pyx_k_tag[] = "tag";
static const char __pyx_k_url[] = "url";
static const char __pyx_k_args[] = "args";
static const char __pyx_k_text[] = "text";
static const char __pyx_k_type[] = "type";
static const char __pyx_k_word[] = "word";
+static const char __pyx_k_ASCII[] = "ASCII";
static const char __pyx_k_XPath[] = "XPath";
static const char __pyx_k_aname[] = "aname";
static const char __pyx_k_avoid[] = "avoid";
static const char __pyx_k_pre_children[] = "pre_children";
static const char __pyx_k_unquote_plus[] = "unquote_plus";
static const char __pyx_k_urllib_parse[] = "urllib.parse";
+static const char __pyx_k_version_info[] = "version_info";
static const char __pyx_k_allow_element[] = "allow_element";
static const char __pyx_k_annoying_tags[] = "annoying_tags";
static const char __pyx_k_autolink_html[] = "autolink_html";
static const char __pyx_k_avoid_classes[] = "avoid_classes";
static const char __pyx_k_avoid_hosts_2[] = "_avoid_hosts";
-static const char __pyx_k_css_import_re[] = "_css_import_re";
static const char __pyx_k_kill_elements[] = "_kill_elements";
static const char __pyx_k_rewrite_links[] = "rewrite_links";
static const char __pyx_k_tail_children[] = "tail_children";
static const char __pyx_k_not_an_attribute[] = "not_an_attribute";
static const char __pyx_k_strip_attributes[] = "strip_attributes";
static const char __pyx_k_transform_result[] = "_transform_result";
-static const char __pyx_k_css_javascript_re[] = "_css_javascript_re";
static const char __pyx_k_data_image_base64[] = "^data:image/.+;base64";
static const char __pyx_k_resolve_base_href[] = "resolve_base_href";
static const char __pyx_k_Cleaner_clean_html[] = "Cleaner.clean_html";
static const char __pyx_k_allow_embedded_url[] = "allow_embedded_url";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
+static const char __pyx_k_replace_css_import[] = "_replace_css_import";
+static const char __pyx_k_a_zA_Z_son_a_zA_Z_s[] = "</?[a-zA-Z]+|\\son[a-zA-Z]+\\s*=";
static const char __pyx_k_find_external_links[] = "_find_external_links";
static const char __pyx_k_remove_unknown_tags[] = "remove_unknown_tags";
static const char __pyx_k_substitute_comments[] = "_substitute_comments";
static const char __pyx_k_substitute_whitespace[] = "_substitute_whitespace";
static const char __pyx_k_Cleaner__kill_elements[] = "Cleaner._kill_elements";
static const char __pyx_k_conditional_comment_re[] = "_conditional_comment_re";
+static const char __pyx_k_looks_like_tag_content[] = "_looks_like_tag_content";
static const char __pyx_k_remove_javascript_link[] = "_remove_javascript_link";
+static const char __pyx_k_replace_css_javascript[] = "_replace_css_javascript";
static const char __pyx_k_src_lxml_html_clean_py[] = "src/lxml/html/clean.py";
static const char __pyx_k_has_conditional_comment[] = "has_conditional_comment";
static const char __pyx_k_processing_instructions[] = "processing_instructions";
static const char __pyx_k_descendant_or_self_a_normalize_s[] = "descendant-or-self::a [normalize-space(@href) and substring(normalize-space(@href),1,1) != '#'] |descendant-or-self::x:a[normalize-space(@href) and substring(normalize-space(@href),1,1) != '#']";
static const char __pyx_k_Cleaner_kill_conditional_comment_2[] = "Cleaner.kill_conditional_comments";
static PyObject *__pyx_kp_s_127_0_0_1;
+static PyObject *__pyx_n_s_ASCII;
static PyObject *__pyx_n_s_AttributeError;
static PyObject *__pyx_n_s_Cleaner;
static PyObject *__pyx_n_s_Cleaner___call;
static PyObject *__pyx_kp_s__15;
static PyObject *__pyx_kp_s__16;
static PyObject *__pyx_kp_s__2;
-static PyObject *__pyx_kp_s__41;
+static PyObject *__pyx_kp_s__42;
static PyObject *__pyx_n_s_a;
static PyObject *__pyx_kp_s_a_z;
+static PyObject *__pyx_kp_s_a_zA_Z_son_a_zA_Z_s;
static PyObject *__pyx_n_s_add_nofollow;
static PyObject *__pyx_n_s_all;
static PyObject *__pyx_n_s_allow_element;
static PyObject *__pyx_n_s_condition;
static PyObject *__pyx_n_s_conditional_comment_re;
static PyObject *__pyx_n_s_copy;
-static PyObject *__pyx_n_s_css_import_re;
-static PyObject *__pyx_n_s_css_javascript_re;
static PyObject *__pyx_kp_s_data_image_base64;
static PyObject *__pyx_n_s_deepcopy;
static PyObject *__pyx_n_s_default;
static PyObject *__pyx_n_s_link_text;
static PyObject *__pyx_n_s_links;
static PyObject *__pyx_kp_s_localhost;
+static PyObject *__pyx_n_s_looks_like_tag_content;
static PyObject *__pyx_n_s_lower;
static PyObject *__pyx_n_s_lxml;
static PyObject *__pyx_n_s_lxml_html;
static PyObject *__pyx_n_s_remove_tags;
static PyObject *__pyx_n_s_remove_unknown_tags;
static PyObject *__pyx_n_s_replace;
+static PyObject *__pyx_n_s_replace_css_import;
+static PyObject *__pyx_n_s_replace_css_javascript;
static PyObject *__pyx_n_s_replacement;
static PyObject *__pyx_n_s_resolve_base_href;
static PyObject *__pyx_n_s_result;
static PyObject *__pyx_n_s_sub;
static PyObject *__pyx_n_s_substitute_comments;
static PyObject *__pyx_n_s_substitute_whitespace;
+static PyObject *__pyx_n_s_sys;
static PyObject *__pyx_n_s_tag;
static PyObject *__pyx_n_s_tag_link_attrs;
static PyObject *__pyx_n_s_tags;
static PyObject *__pyx_n_s_urlparse;
static PyObject *__pyx_n_s_urlsplit;
static PyObject *__pyx_n_s_value;
+static PyObject *__pyx_n_s_version_info;
static PyObject *__pyx_n_s_whitelist_tags;
static PyObject *__pyx_n_s_width;
static PyObject *__pyx_n_s_word;
static __Pyx_CachedCFunction __pyx_umethod_PySet_Type_update = {0, &__pyx_n_s_update, 0, 0, 0};
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
+static PyObject *__pyx_int_3;
static PyObject *__pyx_int_10;
static PyObject *__pyx_int_40;
static PyObject *__pyx_int_8203;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__18;
-static PyObject *__pyx_tuple__20;
+static PyObject *__pyx_tuple__19;
static PyObject *__pyx_tuple__21;
static PyObject *__pyx_tuple__22;
static PyObject *__pyx_tuple__23;
static PyObject *__pyx_tuple__24;
-static PyObject *__pyx_tuple__26;
-static PyObject *__pyx_tuple__28;
-static PyObject *__pyx_tuple__30;
-static PyObject *__pyx_tuple__32;
-static PyObject *__pyx_tuple__34;
-static PyObject *__pyx_tuple__36;
-static PyObject *__pyx_tuple__38;
+static PyObject *__pyx_tuple__25;
+static PyObject *__pyx_tuple__27;
+static PyObject *__pyx_tuple__29;
+static PyObject *__pyx_tuple__31;
+static PyObject *__pyx_tuple__33;
+static PyObject *__pyx_tuple__35;
+static PyObject *__pyx_tuple__37;
static PyObject *__pyx_tuple__39;
-static PyObject *__pyx_tuple__42;
-static PyObject *__pyx_tuple__44;
-static PyObject *__pyx_tuple__46;
+static PyObject *__pyx_tuple__40;
+static PyObject *__pyx_tuple__43;
+static PyObject *__pyx_tuple__45;
static PyObject *__pyx_tuple__47;
-static PyObject *__pyx_tuple__49;
-static PyObject *__pyx_tuple__51;
-static PyObject *__pyx_tuple__53;
-static PyObject *__pyx_tuple__55;
+static PyObject *__pyx_tuple__48;
+static PyObject *__pyx_tuple__50;
+static PyObject *__pyx_tuple__52;
+static PyObject *__pyx_tuple__54;
static PyObject *__pyx_tuple__56;
-static PyObject *__pyx_tuple__58;
-static PyObject *__pyx_tuple__60;
-static PyObject *__pyx_codeobj__19;
-static PyObject *__pyx_codeobj__25;
-static PyObject *__pyx_codeobj__27;
-static PyObject *__pyx_codeobj__29;
-static PyObject *__pyx_codeobj__31;
-static PyObject *__pyx_codeobj__33;
-static PyObject *__pyx_codeobj__35;
-static PyObject *__pyx_codeobj__37;
-static PyObject *__pyx_codeobj__40;
-static PyObject *__pyx_codeobj__43;
-static PyObject *__pyx_codeobj__45;
-static PyObject *__pyx_codeobj__48;
-static PyObject *__pyx_codeobj__50;
-static PyObject *__pyx_codeobj__52;
-static PyObject *__pyx_codeobj__54;
-static PyObject *__pyx_codeobj__57;
-static PyObject *__pyx_codeobj__59;
-static PyObject *__pyx_codeobj__61;
+static PyObject *__pyx_tuple__57;
+static PyObject *__pyx_tuple__59;
+static PyObject *__pyx_tuple__61;
+static PyObject *__pyx_codeobj__20;
+static PyObject *__pyx_codeobj__26;
+static PyObject *__pyx_codeobj__28;
+static PyObject *__pyx_codeobj__30;
+static PyObject *__pyx_codeobj__32;
+static PyObject *__pyx_codeobj__34;
+static PyObject *__pyx_codeobj__36;
+static PyObject *__pyx_codeobj__38;
+static PyObject *__pyx_codeobj__41;
+static PyObject *__pyx_codeobj__44;
+static PyObject *__pyx_codeobj__46;
+static PyObject *__pyx_codeobj__49;
+static PyObject *__pyx_codeobj__51;
+static PyObject *__pyx_codeobj__53;
+static PyObject *__pyx_codeobj__55;
+static PyObject *__pyx_codeobj__58;
+static PyObject *__pyx_codeobj__60;
+static PyObject *__pyx_codeobj__62;
/* Late includes */
-/* "lxml/html/clean.py":78
+/* "lxml/html/clean.py":83
* r'(?:javascript|jscript|livescript|vbscript|data|about|mocha):',
* re.I).search
* def _is_javascript_scheme(s): # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_is_javascript_scheme", 0);
- /* "lxml/html/clean.py":79
+ /* "lxml/html/clean.py":84
* re.I).search
* def _is_javascript_scheme(s):
* if _is_image_dataurl(s): # <<<<<<<<<<<<<<
* return None
* return _is_possibly_malicious_scheme(s)
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_image_dataurl); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_image_dataurl); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_s) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_s);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 79, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 84, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_4) {
- /* "lxml/html/clean.py":80
+ /* "lxml/html/clean.py":85
* def _is_javascript_scheme(s):
* if _is_image_dataurl(s):
* return None # <<<<<<<<<<<<<<
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
- /* "lxml/html/clean.py":79
+ /* "lxml/html/clean.py":84
* re.I).search
* def _is_javascript_scheme(s):
* if _is_image_dataurl(s): # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":81
+ /* "lxml/html/clean.py":86
* if _is_image_dataurl(s):
* return None
* return _is_possibly_malicious_scheme(s) # <<<<<<<<<<<<<<
* _substitute_whitespace = re.compile(r'[\s\x00-\x08\x0B\x0C\x0E-\x19]+').sub
*/
__Pyx_XDECREF(__pyx_r);
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_possibly_malicious_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_possibly_malicious_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_s) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_s);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "lxml/html/clean.py":78
+ /* "lxml/html/clean.py":83
* r'(?:javascript|jscript|livescript|vbscript|data|about|mocha):',
* re.I).search
* def _is_javascript_scheme(s): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "lxml/html/clean.py":217
+/* "lxml/html/clean.py":222
* whitelist_tags = {'iframe', 'embed'}
*
* def __init__(self, **kw): # <<<<<<<<<<<<<<
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 217, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 222, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 217, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 222, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
__Pyx_AddTraceback("lxml.html.clean.Cleaner.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "lxml/html/clean.py":218
+ /* "lxml/html/clean.py":223
*
* def __init__(self, **kw):
* not_an_attribute = object() # <<<<<<<<<<<<<<
* for name, value in kw.items():
* default = getattr(self, name, not_an_attribute)
*/
- __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_object); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_object); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_not_an_attribute = __pyx_t_1;
__pyx_t_1 = 0;
- /* "lxml/html/clean.py":219
+ /* "lxml/html/clean.py":224
* def __init__(self, **kw):
* not_an_attribute = object()
* for name, value in kw.items(): # <<<<<<<<<<<<<<
* if (default is not None and default is not True and default is not False
*/
__pyx_t_2 = 0;
- __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_kw, 1, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 219, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_kw, 1, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 224, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_1);
__pyx_t_1 = __pyx_t_5;
while (1) {
__pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4);
if (unlikely(__pyx_t_7 == 0)) break;
- if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 219, __pyx_L1_error)
+ if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 224, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_t_6);
__Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5);
__Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
__pyx_t_6 = 0;
- /* "lxml/html/clean.py":220
+ /* "lxml/html/clean.py":225
* not_an_attribute = object()
* for name, value in kw.items():
* default = getattr(self, name, not_an_attribute) # <<<<<<<<<<<<<<
* if (default is not None and default is not True and default is not False
* and not isinstance(default, (frozenset, set, tuple, list))):
*/
- __pyx_t_6 = __Pyx_GetAttr3(__pyx_v_self, __pyx_v_name, __pyx_v_not_an_attribute); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 220, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_GetAttr3(__pyx_v_self, __pyx_v_name, __pyx_v_not_an_attribute); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 225, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_XDECREF_SET(__pyx_v_default, __pyx_t_6);
__pyx_t_6 = 0;
- /* "lxml/html/clean.py":221
+ /* "lxml/html/clean.py":226
* for name, value in kw.items():
* default = getattr(self, name, not_an_attribute)
* if (default is not None and default is not True and default is not False # <<<<<<<<<<<<<<
goto __pyx_L6_bool_binop_done;
}
- /* "lxml/html/clean.py":222
+ /* "lxml/html/clean.py":227
* default = getattr(self, name, not_an_attribute)
* if (default is not None and default is not True and default is not False
* and not isinstance(default, (frozenset, set, tuple, list))): # <<<<<<<<<<<<<<
*/
__pyx_t_9 = (__pyx_v_default != Py_False);
- /* "lxml/html/clean.py":221
+ /* "lxml/html/clean.py":226
* for name, value in kw.items():
* default = getattr(self, name, not_an_attribute)
* if (default is not None and default is not True and default is not False # <<<<<<<<<<<<<<
goto __pyx_L6_bool_binop_done;
}
- /* "lxml/html/clean.py":222
+ /* "lxml/html/clean.py":227
* default = getattr(self, name, not_an_attribute)
* if (default is not None and default is not True and default is not False
* and not isinstance(default, (frozenset, set, tuple, list))): # <<<<<<<<<<<<<<
__pyx_t_8 = __pyx_t_9;
__pyx_L6_bool_binop_done:;
- /* "lxml/html/clean.py":221
+ /* "lxml/html/clean.py":226
* for name, value in kw.items():
* default = getattr(self, name, not_an_attribute)
* if (default is not None and default is not True and default is not False # <<<<<<<<<<<<<<
*/
if (unlikely(__pyx_t_8)) {
- /* "lxml/html/clean.py":224
+ /* "lxml/html/clean.py":229
* and not isinstance(default, (frozenset, set, tuple, list))):
* raise TypeError(
* "Unknown parameter: %s=%r" % (name, value)) # <<<<<<<<<<<<<<
* setattr(self, name, value)
* if self.inline_style is None and 'inline_style' not in kw:
*/
- __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 224, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 229, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(__pyx_v_name);
__Pyx_GIVEREF(__pyx_v_name);
__Pyx_INCREF(__pyx_v_value);
__Pyx_GIVEREF(__pyx_v_value);
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_value);
- __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Unknown_parameter_s_r, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 224, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Unknown_parameter_s_r, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 229, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "lxml/html/clean.py":223
+ /* "lxml/html/clean.py":228
* if (default is not None and default is not True and default is not False
* and not isinstance(default, (frozenset, set, tuple, list))):
* raise TypeError( # <<<<<<<<<<<<<<
* "Unknown parameter: %s=%r" % (name, value))
* setattr(self, name, value)
*/
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 223, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __PYX_ERR(0, 223, __pyx_L1_error)
+ __PYX_ERR(0, 228, __pyx_L1_error)
- /* "lxml/html/clean.py":221
+ /* "lxml/html/clean.py":226
* for name, value in kw.items():
* default = getattr(self, name, not_an_attribute)
* if (default is not None and default is not True and default is not False # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":225
+ /* "lxml/html/clean.py":230
* raise TypeError(
* "Unknown parameter: %s=%r" % (name, value))
* setattr(self, name, value) # <<<<<<<<<<<<<<
* if self.inline_style is None and 'inline_style' not in kw:
* self.inline_style = self.style
*/
- __pyx_t_12 = PyObject_SetAttr(__pyx_v_self, __pyx_v_name, __pyx_v_value); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 225, __pyx_L1_error)
+ __pyx_t_12 = PyObject_SetAttr(__pyx_v_self, __pyx_v_name, __pyx_v_value); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 230, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "lxml/html/clean.py":226
+ /* "lxml/html/clean.py":231
* "Unknown parameter: %s=%r" % (name, value))
* setattr(self, name, value)
* if self.inline_style is None and 'inline_style' not in kw: # <<<<<<<<<<<<<<
* self.inline_style = self.style
*
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_inline_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_inline_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_9 = (__pyx_t_1 == Py_None);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_8 = __pyx_t_10;
goto __pyx_L15_bool_binop_done;
}
- __pyx_t_10 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_inline_style, __pyx_v_kw, Py_NE)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 226, __pyx_L1_error)
+ __pyx_t_10 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_inline_style, __pyx_v_kw, Py_NE)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 231, __pyx_L1_error)
__pyx_t_9 = (__pyx_t_10 != 0);
__pyx_t_8 = __pyx_t_9;
__pyx_L15_bool_binop_done:;
if (__pyx_t_8) {
- /* "lxml/html/clean.py":227
+ /* "lxml/html/clean.py":232
* setattr(self, name, value)
* if self.inline_style is None and 'inline_style' not in kw:
* self.inline_style = self.style # <<<<<<<<<<<<<<
*
* if kw.get("allow_tags"):
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_inline_style, __pyx_t_1) < 0) __PYX_ERR(0, 227, __pyx_L1_error)
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_inline_style, __pyx_t_1) < 0) __PYX_ERR(0, 232, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "lxml/html/clean.py":226
+ /* "lxml/html/clean.py":231
* "Unknown parameter: %s=%r" % (name, value))
* setattr(self, name, value)
* if self.inline_style is None and 'inline_style' not in kw: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":229
+ /* "lxml/html/clean.py":234
* self.inline_style = self.style
*
* if kw.get("allow_tags"): # <<<<<<<<<<<<<<
* if kw.get("remove_unknown_tags"):
* raise ValueError("It does not make sense to pass in both "
*/
- __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_kw, __pyx_n_s_allow_tags, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_kw, __pyx_n_s_allow_tags, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 229, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 234, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_8) {
- /* "lxml/html/clean.py":230
+ /* "lxml/html/clean.py":235
*
* if kw.get("allow_tags"):
* if kw.get("remove_unknown_tags"): # <<<<<<<<<<<<<<
* raise ValueError("It does not make sense to pass in both "
* "allow_tags and remove_unknown_tags")
*/
- __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_kw, __pyx_n_s_remove_unknown_tags, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_kw, __pyx_n_s_remove_unknown_tags, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 230, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 235, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(__pyx_t_8)) {
- /* "lxml/html/clean.py":231
+ /* "lxml/html/clean.py":236
* if kw.get("allow_tags"):
* if kw.get("remove_unknown_tags"):
* raise ValueError("It does not make sense to pass in both " # <<<<<<<<<<<<<<
* "allow_tags and remove_unknown_tags")
* self.remove_unknown_tags = False
*/
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __PYX_ERR(0, 231, __pyx_L1_error)
+ __PYX_ERR(0, 236, __pyx_L1_error)
- /* "lxml/html/clean.py":230
+ /* "lxml/html/clean.py":235
*
* if kw.get("allow_tags"):
* if kw.get("remove_unknown_tags"): # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":233
+ /* "lxml/html/clean.py":238
* raise ValueError("It does not make sense to pass in both "
* "allow_tags and remove_unknown_tags")
* self.remove_unknown_tags = False # <<<<<<<<<<<<<<
*
* # Used to lookup the primary URL for a given tag that is up for
*/
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_remove_unknown_tags, Py_False) < 0) __PYX_ERR(0, 233, __pyx_L1_error)
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_remove_unknown_tags, Py_False) < 0) __PYX_ERR(0, 238, __pyx_L1_error)
- /* "lxml/html/clean.py":229
+ /* "lxml/html/clean.py":234
* self.inline_style = self.style
*
* if kw.get("allow_tags"): # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":217
+ /* "lxml/html/clean.py":222
* whitelist_tags = {'iframe', 'embed'}
*
* def __init__(self, **kw): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "lxml/html/clean.py":257
+/* "lxml/html/clean.py":262
* )
*
* def __call__(self, doc): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_doc)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, 1); __PYX_ERR(0, 257, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, 1); __PYX_ERR(0, 262, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 257, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 262, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 257, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 262, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("lxml.html.clean.Cleaner.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
__Pyx_RefNannySetupContext("__call__", 0);
__Pyx_INCREF(__pyx_v_doc);
- /* "lxml/html/clean.py":261
+ /* "lxml/html/clean.py":266
* Cleans the document.
* """
* try: # <<<<<<<<<<<<<<
__Pyx_XGOTREF(__pyx_t_3);
/*try:*/ {
- /* "lxml/html/clean.py":262
+ /* "lxml/html/clean.py":267
* """
* try:
* getroot = doc.getroot # <<<<<<<<<<<<<<
* except AttributeError:
* pass # Element instance
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_getroot); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 262, __pyx_L3_error)
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_getroot); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 267, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_v_getroot = __pyx_t_4;
__pyx_t_4 = 0;
- /* "lxml/html/clean.py":261
+ /* "lxml/html/clean.py":266
* Cleans the document.
* """
* try: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":266
+ /* "lxml/html/clean.py":271
* pass # Element instance
* else:
* doc = getroot() # ElementTree instance, instead of an element # <<<<<<<<<<<<<<
}
__pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L5_except_error)
+ if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF_SET(__pyx_v_doc, __pyx_t_4);
__pyx_L3_error:;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "lxml/html/clean.py":263
+ /* "lxml/html/clean.py":268
* try:
* getroot = doc.getroot
* except AttributeError: # <<<<<<<<<<<<<<
goto __pyx_L5_except_error;
__pyx_L5_except_error:;
- /* "lxml/html/clean.py":261
+ /* "lxml/html/clean.py":266
* Cleans the document.
* """
* try: # <<<<<<<<<<<<<<
__pyx_L8_try_end:;
}
- /* "lxml/html/clean.py":268
+ /* "lxml/html/clean.py":273
* doc = getroot() # ElementTree instance, instead of an element
* # convert XHTML to HTML
* xhtml_to_html(doc) # <<<<<<<<<<<<<<
* # Normalize a case that IE treats <image> like <img>, and that
* # can confuse either this step or later steps.
*/
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_xhtml_to_html); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_xhtml_to_html); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 273, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
}
__pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_doc) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_doc);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error)
+ if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 273, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "lxml/html/clean.py":271
+ /* "lxml/html/clean.py":276
* # Normalize a case that IE treats <image> like <img>, and that
* # can confuse either this step or later steps.
* for el in doc.iter('image'): # <<<<<<<<<<<<<<
* el.tag = 'img'
* if not self.comments:
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_iter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 271, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_iter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 276, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
}
__pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_image) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_image);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error)
+ if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 276, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
__pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
__pyx_t_9 = NULL;
} else {
- __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 271, __pyx_L1_error)
+ __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 276, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 271, __pyx_L1_error)
+ __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 276, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
for (;;) {
if (likely(PyList_CheckExact(__pyx_t_5))) {
if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 271, __pyx_L1_error)
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 276, __pyx_L1_error)
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error)
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 276, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
#endif
} else {
if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 271, __pyx_L1_error)
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 276, __pyx_L1_error)
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error)
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 276, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
#endif
}
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 271, __pyx_L1_error)
+ else __PYX_ERR(0, 276, __pyx_L1_error)
}
break;
}
__Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_4);
__pyx_t_4 = 0;
- /* "lxml/html/clean.py":272
+ /* "lxml/html/clean.py":277
* # can confuse either this step or later steps.
* for el in doc.iter('image'):
* el.tag = 'img' # <<<<<<<<<<<<<<
* if not self.comments:
* # Of course, if we were going to kill comments anyway, we don't
*/
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_tag, __pyx_n_s_img) < 0) __PYX_ERR(0, 272, __pyx_L1_error)
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_tag, __pyx_n_s_img) < 0) __PYX_ERR(0, 277, __pyx_L1_error)
- /* "lxml/html/clean.py":271
+ /* "lxml/html/clean.py":276
* # Normalize a case that IE treats <image> like <img>, and that
* # can confuse either this step or later steps.
* for el in doc.iter('image'): # <<<<<<<<<<<<<<
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":273
+ /* "lxml/html/clean.py":278
* for el in doc.iter('image'):
* el.tag = 'img'
* if not self.comments: # <<<<<<<<<<<<<<
* # Of course, if we were going to kill comments anyway, we don't
* # need to worry about this
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_comments); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 273, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_comments); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 278, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 273, __pyx_L1_error)
+ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 278, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_11 = ((!__pyx_t_10) != 0);
if (__pyx_t_11) {
- /* "lxml/html/clean.py":276
+ /* "lxml/html/clean.py":281
* # Of course, if we were going to kill comments anyway, we don't
* # need to worry about this
* self.kill_conditional_comments(doc) # <<<<<<<<<<<<<<
*
* kill_tags = set(self.kill_tags or ())
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_kill_conditional_comments); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 276, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_kill_conditional_comments); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 281, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
}
__pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_v_doc) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_doc);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 276, __pyx_L1_error)
+ if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 281, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":273
+ /* "lxml/html/clean.py":278
* for el in doc.iter('image'):
* el.tag = 'img'
* if not self.comments: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":278
+ /* "lxml/html/clean.py":283
* self.kill_conditional_comments(doc)
*
* kill_tags = set(self.kill_tags or ()) # <<<<<<<<<<<<<<
* remove_tags = set(self.remove_tags or ())
* allow_tags = set(self.allow_tags or ())
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_kill_tags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 278, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_kill_tags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 283, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 278, __pyx_L1_error)
+ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 283, __pyx_L1_error)
if (!__pyx_t_11) {
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
__Pyx_INCREF(__pyx_empty_tuple);
__pyx_t_5 = __pyx_empty_tuple;
__pyx_L12_bool_binop_done:;
- __pyx_t_4 = PySet_New(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 278, __pyx_L1_error)
+ __pyx_t_4 = PySet_New(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 283, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_kill_tags = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
- /* "lxml/html/clean.py":279
+ /* "lxml/html/clean.py":284
*
* kill_tags = set(self.kill_tags or ())
* remove_tags = set(self.remove_tags or ()) # <<<<<<<<<<<<<<
* allow_tags = set(self.allow_tags or ())
*
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_remove_tags); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 279, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_remove_tags); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 284, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 279, __pyx_L1_error)
+ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 284, __pyx_L1_error)
if (!__pyx_t_11) {
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else {
__Pyx_INCREF(__pyx_empty_tuple);
__pyx_t_4 = __pyx_empty_tuple;
__pyx_L14_bool_binop_done:;
- __pyx_t_5 = PySet_New(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 279, __pyx_L1_error)
+ __pyx_t_5 = PySet_New(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 284, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_remove_tags = ((PyObject*)__pyx_t_5);
__pyx_t_5 = 0;
- /* "lxml/html/clean.py":280
+ /* "lxml/html/clean.py":285
* kill_tags = set(self.kill_tags or ())
* remove_tags = set(self.remove_tags or ())
* allow_tags = set(self.allow_tags or ()) # <<<<<<<<<<<<<<
*
* if self.scripts:
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_allow_tags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 280, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_allow_tags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 285, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 280, __pyx_L1_error)
+ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 285, __pyx_L1_error)
if (!__pyx_t_11) {
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
__Pyx_INCREF(__pyx_empty_tuple);
__pyx_t_5 = __pyx_empty_tuple;
__pyx_L16_bool_binop_done:;
- __pyx_t_4 = PySet_New(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 280, __pyx_L1_error)
+ __pyx_t_4 = PySet_New(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 285, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_allow_tags = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
- /* "lxml/html/clean.py":282
+ /* "lxml/html/clean.py":287
* allow_tags = set(self.allow_tags or ())
*
* if self.scripts: # <<<<<<<<<<<<<<
* kill_tags.add('script')
* if self.safe_attrs_only:
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scripts); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scripts); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 282, __pyx_L1_error)
+ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 287, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_11) {
- /* "lxml/html/clean.py":283
+ /* "lxml/html/clean.py":288
*
* if self.scripts:
* kill_tags.add('script') # <<<<<<<<<<<<<<
* if self.safe_attrs_only:
* safe_attrs = set(self.safe_attrs)
*/
- __pyx_t_12 = PySet_Add(__pyx_v_kill_tags, __pyx_n_s_script); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 283, __pyx_L1_error)
+ __pyx_t_12 = PySet_Add(__pyx_v_kill_tags, __pyx_n_s_script); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 288, __pyx_L1_error)
- /* "lxml/html/clean.py":282
+ /* "lxml/html/clean.py":287
* allow_tags = set(self.allow_tags or ())
*
* if self.scripts: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":284
+ /* "lxml/html/clean.py":289
* if self.scripts:
* kill_tags.add('script')
* if self.safe_attrs_only: # <<<<<<<<<<<<<<
* safe_attrs = set(self.safe_attrs)
* for el in doc.iter(etree.Element):
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_safe_attrs_only); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_safe_attrs_only); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 284, __pyx_L1_error)
+ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 289, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_11) {
- /* "lxml/html/clean.py":285
+ /* "lxml/html/clean.py":290
* kill_tags.add('script')
* if self.safe_attrs_only:
* safe_attrs = set(self.safe_attrs) # <<<<<<<<<<<<<<
* for el in doc.iter(etree.Element):
* attrib = el.attrib
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_safe_attrs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 285, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_safe_attrs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 290, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PySet_New(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 285, __pyx_L1_error)
+ __pyx_t_5 = PySet_New(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 290, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_safe_attrs = ((PyObject*)__pyx_t_5);
__pyx_t_5 = 0;
- /* "lxml/html/clean.py":286
+ /* "lxml/html/clean.py":291
* if self.safe_attrs_only:
* safe_attrs = set(self.safe_attrs)
* for el in doc.iter(etree.Element): # <<<<<<<<<<<<<<
* attrib = el.attrib
* for aname in attrib.keys():
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_iter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_iter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 291, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_etree); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 286, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_etree); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 291, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_Element); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 286, __pyx_L1_error)
+ __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_Element); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 291, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = NULL;
__pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_13) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_13);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 286, __pyx_L1_error)
+ if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 291, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
__pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0;
__pyx_t_9 = NULL;
} else {
- __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error)
+ __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 291, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 286, __pyx_L1_error)
+ __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 291, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
for (;;) {
if (likely(PyList_CheckExact(__pyx_t_4))) {
if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 286, __pyx_L1_error)
+ __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 291, __pyx_L1_error)
#else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 286, __pyx_L1_error)
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 291, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
#endif
} else {
if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 286, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 291, __pyx_L1_error)
#else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 286, __pyx_L1_error)
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 291, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
#endif
}
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 286, __pyx_L1_error)
+ else __PYX_ERR(0, 291, __pyx_L1_error)
}
break;
}
__Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_5);
__pyx_t_5 = 0;
- /* "lxml/html/clean.py":287
+ /* "lxml/html/clean.py":292
* safe_attrs = set(self.safe_attrs)
* for el in doc.iter(etree.Element):
* attrib = el.attrib # <<<<<<<<<<<<<<
* for aname in attrib.keys():
* if aname not in safe_attrs:
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_attrib); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 287, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_attrib); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 292, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_XDECREF_SET(__pyx_v_attrib, __pyx_t_5);
__pyx_t_5 = 0;
- /* "lxml/html/clean.py":288
+ /* "lxml/html/clean.py":293
* for el in doc.iter(etree.Element):
* attrib = el.attrib
* for aname in attrib.keys(): # <<<<<<<<<<<<<<
__pyx_t_14 = 0;
if (unlikely(__pyx_v_attrib == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys");
- __PYX_ERR(0, 288, __pyx_L1_error)
+ __PYX_ERR(0, 293, __pyx_L1_error)
}
- __pyx_t_13 = __Pyx_dict_iterator(__pyx_v_attrib, 0, __pyx_n_s_keys, (&__pyx_t_15), (&__pyx_t_7)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 288, __pyx_L1_error)
+ __pyx_t_13 = __Pyx_dict_iterator(__pyx_v_attrib, 0, __pyx_n_s_keys, (&__pyx_t_15), (&__pyx_t_7)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 293, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
__Pyx_XDECREF(__pyx_t_5);
__pyx_t_5 = __pyx_t_13;
while (1) {
__pyx_t_16 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_15, &__pyx_t_14, &__pyx_t_13, NULL, NULL, __pyx_t_7);
if (unlikely(__pyx_t_16 == 0)) break;
- if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(0, 288, __pyx_L1_error)
+ if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(0, 293, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
__Pyx_XDECREF_SET(__pyx_v_aname, __pyx_t_13);
__pyx_t_13 = 0;
- /* "lxml/html/clean.py":289
+ /* "lxml/html/clean.py":294
* attrib = el.attrib
* for aname in attrib.keys():
* if aname not in safe_attrs: # <<<<<<<<<<<<<<
* del attrib[aname]
* if self.javascript:
*/
- __pyx_t_11 = (__Pyx_PySet_ContainsTF(__pyx_v_aname, __pyx_v_safe_attrs, Py_NE)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 289, __pyx_L1_error)
+ __pyx_t_11 = (__Pyx_PySet_ContainsTF(__pyx_v_aname, __pyx_v_safe_attrs, Py_NE)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 294, __pyx_L1_error)
__pyx_t_10 = (__pyx_t_11 != 0);
if (__pyx_t_10) {
- /* "lxml/html/clean.py":290
+ /* "lxml/html/clean.py":295
* for aname in attrib.keys():
* if aname not in safe_attrs:
* del attrib[aname] # <<<<<<<<<<<<<<
* if self.javascript:
* if not (self.safe_attrs_only and
*/
- if (unlikely(PyObject_DelItem(__pyx_v_attrib, __pyx_v_aname) < 0)) __PYX_ERR(0, 290, __pyx_L1_error)
+ if (unlikely(PyObject_DelItem(__pyx_v_attrib, __pyx_v_aname) < 0)) __PYX_ERR(0, 295, __pyx_L1_error)
- /* "lxml/html/clean.py":289
+ /* "lxml/html/clean.py":294
* attrib = el.attrib
* for aname in attrib.keys():
* if aname not in safe_attrs: # <<<<<<<<<<<<<<
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":286
+ /* "lxml/html/clean.py":291
* if self.safe_attrs_only:
* safe_attrs = set(self.safe_attrs)
* for el in doc.iter(etree.Element): # <<<<<<<<<<<<<<
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "lxml/html/clean.py":284
+ /* "lxml/html/clean.py":289
* if self.scripts:
* kill_tags.add('script')
* if self.safe_attrs_only: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":291
+ /* "lxml/html/clean.py":296
* if aname not in safe_attrs:
* del attrib[aname]
* if self.javascript: # <<<<<<<<<<<<<<
* if not (self.safe_attrs_only and
* self.safe_attrs == defs.safe_attrs):
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_javascript); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 291, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_javascript); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 296, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 291, __pyx_L1_error)
+ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 296, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_10) {
- /* "lxml/html/clean.py":292
+ /* "lxml/html/clean.py":297
* del attrib[aname]
* if self.javascript:
* if not (self.safe_attrs_only and # <<<<<<<<<<<<<<
* self.safe_attrs == defs.safe_attrs):
* # safe_attrs handles events attributes itself
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_safe_attrs_only); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 292, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_safe_attrs_only); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 292, __pyx_L1_error)
+ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 297, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_11) {
} else {
goto __pyx_L27_bool_binop_done;
}
- /* "lxml/html/clean.py":293
+ /* "lxml/html/clean.py":298
* if self.javascript:
* if not (self.safe_attrs_only and
* self.safe_attrs == defs.safe_attrs): # <<<<<<<<<<<<<<
* # safe_attrs handles events attributes itself
* for el in doc.iter(etree.Element):
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_safe_attrs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 293, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_safe_attrs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 298, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_defs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 293, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_defs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 298, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_safe_attrs); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 293, __pyx_L1_error)
+ __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_safe_attrs); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 298, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 293, __pyx_L1_error)
+ __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 298, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 293, __pyx_L1_error)
+ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 298, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_10 = __pyx_t_11;
__pyx_L27_bool_binop_done:;
- /* "lxml/html/clean.py":292
+ /* "lxml/html/clean.py":297
* del attrib[aname]
* if self.javascript:
* if not (self.safe_attrs_only and # <<<<<<<<<<<<<<
__pyx_t_11 = ((!__pyx_t_10) != 0);
if (__pyx_t_11) {
- /* "lxml/html/clean.py":295
+ /* "lxml/html/clean.py":300
* self.safe_attrs == defs.safe_attrs):
* # safe_attrs handles events attributes itself
* for el in doc.iter(etree.Element): # <<<<<<<<<<<<<<
* attrib = el.attrib
* for aname in attrib.keys():
*/
- __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_iter); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 295, __pyx_L1_error)
+ __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_iter); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 300, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_etree); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 295, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_etree); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 300, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Element); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 295, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Element); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 300, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
__pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_6);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 295, __pyx_L1_error)
+ if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
__pyx_t_13 = __pyx_t_5; __Pyx_INCREF(__pyx_t_13); __pyx_t_8 = 0;
__pyx_t_9 = NULL;
} else {
- __pyx_t_8 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 295, __pyx_L1_error)
+ __pyx_t_8 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 300, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
- __pyx_t_9 = Py_TYPE(__pyx_t_13)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 295, __pyx_L1_error)
+ __pyx_t_9 = Py_TYPE(__pyx_t_13)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 300, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
for (;;) {
if (likely(PyList_CheckExact(__pyx_t_13))) {
if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_13)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_5 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 295, __pyx_L1_error)
+ __pyx_t_5 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 300, __pyx_L1_error)
#else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_13, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 295, __pyx_L1_error)
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_13, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
#endif
} else {
if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_13)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 295, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 300, __pyx_L1_error)
#else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_13, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 295, __pyx_L1_error)
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_13, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
#endif
}
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 295, __pyx_L1_error)
+ else __PYX_ERR(0, 300, __pyx_L1_error)
}
break;
}
__Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_5);
__pyx_t_5 = 0;
- /* "lxml/html/clean.py":296
+ /* "lxml/html/clean.py":301
* # safe_attrs handles events attributes itself
* for el in doc.iter(etree.Element):
* attrib = el.attrib # <<<<<<<<<<<<<<
* for aname in attrib.keys():
* if aname.startswith('on'):
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_attrib); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 296, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_attrib); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 301, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_XDECREF_SET(__pyx_v_attrib, __pyx_t_5);
__pyx_t_5 = 0;
- /* "lxml/html/clean.py":297
+ /* "lxml/html/clean.py":302
* for el in doc.iter(etree.Element):
* attrib = el.attrib
* for aname in attrib.keys(): # <<<<<<<<<<<<<<
__pyx_t_15 = 0;
if (unlikely(__pyx_v_attrib == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys");
- __PYX_ERR(0, 297, __pyx_L1_error)
+ __PYX_ERR(0, 302, __pyx_L1_error)
}
- __pyx_t_6 = __Pyx_dict_iterator(__pyx_v_attrib, 0, __pyx_n_s_keys, (&__pyx_t_14), (&__pyx_t_7)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 297, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_dict_iterator(__pyx_v_attrib, 0, __pyx_n_s_keys, (&__pyx_t_14), (&__pyx_t_7)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 302, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_5);
__pyx_t_5 = __pyx_t_6;
while (1) {
__pyx_t_16 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_14, &__pyx_t_15, &__pyx_t_6, NULL, NULL, __pyx_t_7);
if (unlikely(__pyx_t_16 == 0)) break;
- if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(0, 297, __pyx_L1_error)
+ if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(0, 302, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_XDECREF_SET(__pyx_v_aname, __pyx_t_6);
__pyx_t_6 = 0;
- /* "lxml/html/clean.py":298
+ /* "lxml/html/clean.py":303
* attrib = el.attrib
* for aname in attrib.keys():
* if aname.startswith('on'): # <<<<<<<<<<<<<<
* del attrib[aname]
* doc.rewrite_links(self._remove_javascript_link,
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_aname, __pyx_n_s_startswith); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 298, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_aname, __pyx_n_s_startswith); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 303, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_17 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
}
__pyx_t_6 = (__pyx_t_17) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_17, __pyx_n_s_on) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_s_on);
__Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
- if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 298, __pyx_L1_error)
+ if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 303, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 298, __pyx_L1_error)
+ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 303, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_11) {
- /* "lxml/html/clean.py":299
+ /* "lxml/html/clean.py":304
* for aname in attrib.keys():
* if aname.startswith('on'):
* del attrib[aname] # <<<<<<<<<<<<<<
* doc.rewrite_links(self._remove_javascript_link,
* resolve_base_href=False)
*/
- if (unlikely(PyObject_DelItem(__pyx_v_attrib, __pyx_v_aname) < 0)) __PYX_ERR(0, 299, __pyx_L1_error)
+ if (unlikely(PyObject_DelItem(__pyx_v_attrib, __pyx_v_aname) < 0)) __PYX_ERR(0, 304, __pyx_L1_error)
- /* "lxml/html/clean.py":298
+ /* "lxml/html/clean.py":303
* attrib = el.attrib
* for aname in attrib.keys():
* if aname.startswith('on'): # <<<<<<<<<<<<<<
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":295
+ /* "lxml/html/clean.py":300
* self.safe_attrs == defs.safe_attrs):
* # safe_attrs handles events attributes itself
* for el in doc.iter(etree.Element): # <<<<<<<<<<<<<<
}
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- /* "lxml/html/clean.py":292
+ /* "lxml/html/clean.py":297
* del attrib[aname]
* if self.javascript:
* if not (self.safe_attrs_only and # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":300
+ /* "lxml/html/clean.py":305
* if aname.startswith('on'):
* del attrib[aname]
* doc.rewrite_links(self._remove_javascript_link, # <<<<<<<<<<<<<<
* resolve_base_href=False)
* # If we're deleting style then we don't have to remove JS links
*/
- __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_rewrite_links); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 300, __pyx_L1_error)
+ __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_rewrite_links); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 305, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_remove_javascript_link); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_remove_javascript_link); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 305, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 300, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 305, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
__pyx_t_5 = 0;
- /* "lxml/html/clean.py":301
+ /* "lxml/html/clean.py":306
* del attrib[aname]
* doc.rewrite_links(self._remove_javascript_link,
* resolve_base_href=False) # <<<<<<<<<<<<<<
* # If we're deleting style then we don't have to remove JS links
* # from styles, otherwise...
*/
- __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 301, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 306, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_resolve_base_href, Py_False) < 0) __PYX_ERR(0, 301, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_resolve_base_href, Py_False) < 0) __PYX_ERR(0, 306, __pyx_L1_error)
- /* "lxml/html/clean.py":300
+ /* "lxml/html/clean.py":305
* if aname.startswith('on'):
* del attrib[aname]
* doc.rewrite_links(self._remove_javascript_link, # <<<<<<<<<<<<<<
* resolve_base_href=False)
* # If we're deleting style then we don't have to remove JS links
*/
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 300, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 305, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "lxml/html/clean.py":304
+ /* "lxml/html/clean.py":309
* # If we're deleting style then we don't have to remove JS links
* # from styles, otherwise...
* if not self.inline_style: # <<<<<<<<<<<<<<
* for el in _find_styled_elements(doc):
* old = el.get('style')
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_inline_style); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_inline_style); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 304, __pyx_L1_error)
+ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 309, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_10 = ((!__pyx_t_11) != 0);
if (__pyx_t_10) {
- /* "lxml/html/clean.py":305
+ /* "lxml/html/clean.py":310
* # from styles, otherwise...
* if not self.inline_style:
* for el in _find_styled_elements(doc): # <<<<<<<<<<<<<<
* old = el.get('style')
- * new = _css_javascript_re.sub('', old)
+ * new = _replace_css_javascript('', old)
*/
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_find_styled_elements); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 305, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_find_styled_elements); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 310, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
}
__pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_doc) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_doc);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 305, __pyx_L1_error)
+ if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 310, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
__pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
__pyx_t_9 = NULL;
} else {
- __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 305, __pyx_L1_error)
+ __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 310, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 305, __pyx_L1_error)
+ __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 310, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
for (;;) {
if (likely(PyList_CheckExact(__pyx_t_5))) {
if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 305, __pyx_L1_error)
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 310, __pyx_L1_error)
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 305, __pyx_L1_error)
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 310, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
#endif
} else {
if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 305, __pyx_L1_error)
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 310, __pyx_L1_error)
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 305, __pyx_L1_error)
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 310, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
#endif
}
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 305, __pyx_L1_error)
+ else __PYX_ERR(0, 310, __pyx_L1_error)
}
break;
}
__Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_4);
__pyx_t_4 = 0;
- /* "lxml/html/clean.py":306
+ /* "lxml/html/clean.py":311
* if not self.inline_style:
* for el in _find_styled_elements(doc):
* old = el.get('style') # <<<<<<<<<<<<<<
- * new = _css_javascript_re.sub('', old)
- * new = _css_import_re.sub('', new)
+ * new = _replace_css_javascript('', old)
+ * new = _replace_css_import('', new)
*/
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 306, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_13 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
}
__pyx_t_4 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_13, __pyx_n_s_style) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_n_s_style);
__Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
- if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 306, __pyx_L1_error)
+ if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 311, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF_SET(__pyx_v_old, __pyx_t_4);
__pyx_t_4 = 0;
- /* "lxml/html/clean.py":307
+ /* "lxml/html/clean.py":312
* for el in _find_styled_elements(doc):
* old = el.get('style')
- * new = _css_javascript_re.sub('', old) # <<<<<<<<<<<<<<
- * new = _css_import_re.sub('', new)
+ * new = _replace_css_javascript('', old) # <<<<<<<<<<<<<<
+ * new = _replace_css_import('', new)
* if self._has_sneaky_javascript(new):
*/
- __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_css_javascript_re); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 307, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_replace_css_javascript); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 312, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sub); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 307, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = NULL;
+ __pyx_t_13 = NULL;
__pyx_t_7 = 0;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_13);
- if (likely(__pyx_t_6)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
- __Pyx_INCREF(__pyx_t_6);
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
+ if (likely(__pyx_t_13)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+ __Pyx_INCREF(__pyx_t_13);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_13, function);
+ __Pyx_DECREF_SET(__pyx_t_6, function);
__pyx_t_7 = 1;
}
}
#if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_13)) {
- PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_kp_s__2, __pyx_v_old};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (PyFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_kp_s__2, __pyx_v_old};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 312, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else
#endif
#if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) {
- PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_kp_s__2, __pyx_v_old};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_kp_s__2, __pyx_v_old};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 312, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else
#endif
{
- __pyx_t_17 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 307, __pyx_L1_error)
+ __pyx_t_17 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 312, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_17);
- if (__pyx_t_6) {
- __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_6); __pyx_t_6 = NULL;
+ if (__pyx_t_13) {
+ __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_13); __pyx_t_13 = NULL;
}
__Pyx_INCREF(__pyx_kp_s__2);
__Pyx_GIVEREF(__pyx_kp_s__2);
__Pyx_INCREF(__pyx_v_old);
__Pyx_GIVEREF(__pyx_v_old);
PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_7, __pyx_v_old);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_17, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_17, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 312, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
}
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF_SET(__pyx_v_new, __pyx_t_4);
__pyx_t_4 = 0;
- /* "lxml/html/clean.py":308
+ /* "lxml/html/clean.py":313
* old = el.get('style')
- * new = _css_javascript_re.sub('', old)
- * new = _css_import_re.sub('', new) # <<<<<<<<<<<<<<
+ * new = _replace_css_javascript('', old)
+ * new = _replace_css_import('', new) # <<<<<<<<<<<<<<
* if self._has_sneaky_javascript(new):
* # Something tricky is going on...
*/
- __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_css_import_re); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 308, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_sub); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 308, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_17);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_13 = NULL;
+ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_replace_css_import); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 313, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_17 = NULL;
__pyx_t_7 = 0;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
- __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_17);
- if (likely(__pyx_t_13)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
- __Pyx_INCREF(__pyx_t_13);
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_6);
+ if (likely(__pyx_t_17)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+ __Pyx_INCREF(__pyx_t_17);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_17, function);
+ __Pyx_DECREF_SET(__pyx_t_6, function);
__pyx_t_7 = 1;
}
}
#if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_17)) {
- PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_kp_s__2, __pyx_v_new};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+ if (PyFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_17, __pyx_kp_s__2, __pyx_v_new};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else
#endif
#if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
- PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_kp_s__2, __pyx_v_new};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_17, __pyx_kp_s__2, __pyx_v_new};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else
#endif
{
- __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 308, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (__pyx_t_13) {
- __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_13); __pyx_t_13 = NULL;
+ __pyx_t_13 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 313, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_13);
+ if (__pyx_t_17) {
+ __Pyx_GIVEREF(__pyx_t_17); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_17); __pyx_t_17 = NULL;
}
__Pyx_INCREF(__pyx_kp_s__2);
__Pyx_GIVEREF(__pyx_kp_s__2);
- PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_kp_s__2);
+ PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_7, __pyx_kp_s__2);
__Pyx_INCREF(__pyx_v_new);
__Pyx_GIVEREF(__pyx_v_new);
- PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_v_new);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L1_error)
+ PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_7, __pyx_v_new);
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
}
- __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF_SET(__pyx_v_new, __pyx_t_4);
__pyx_t_4 = 0;
- /* "lxml/html/clean.py":309
- * new = _css_javascript_re.sub('', old)
- * new = _css_import_re.sub('', new)
+ /* "lxml/html/clean.py":314
+ * new = _replace_css_javascript('', old)
+ * new = _replace_css_import('', new)
* if self._has_sneaky_javascript(new): # <<<<<<<<<<<<<<
* # Something tricky is going on...
* del el.attrib['style']
*/
- __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_has_sneaky_javascript); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 309, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_17);
- __pyx_t_6 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_17);
- if (likely(__pyx_t_6)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
- __Pyx_INCREF(__pyx_t_6);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_has_sneaky_javascript); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 314, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_13 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
+ if (likely(__pyx_t_13)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+ __Pyx_INCREF(__pyx_t_13);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_17, function);
+ __Pyx_DECREF_SET(__pyx_t_6, function);
}
}
- __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_17, __pyx_t_6, __pyx_v_new) : __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_v_new);
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error)
+ __pyx_t_4 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_13, __pyx_v_new) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_new);
+ __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+ if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 314, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
- __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 309, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 314, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_10) {
- /* "lxml/html/clean.py":311
+ /* "lxml/html/clean.py":316
* if self._has_sneaky_javascript(new):
* # Something tricky is going on...
* del el.attrib['style'] # <<<<<<<<<<<<<<
* elif new != old:
* el.set('style', new)
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_attrib); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 311, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_attrib); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 316, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- if (unlikely(PyObject_DelItem(__pyx_t_4, __pyx_n_s_style) < 0)) __PYX_ERR(0, 311, __pyx_L1_error)
+ if (unlikely(PyObject_DelItem(__pyx_t_4, __pyx_n_s_style) < 0)) __PYX_ERR(0, 316, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "lxml/html/clean.py":309
- * new = _css_javascript_re.sub('', old)
- * new = _css_import_re.sub('', new)
+ /* "lxml/html/clean.py":314
+ * new = _replace_css_javascript('', old)
+ * new = _replace_css_import('', new)
* if self._has_sneaky_javascript(new): # <<<<<<<<<<<<<<
* # Something tricky is going on...
* del el.attrib['style']
goto __pyx_L37;
}
- /* "lxml/html/clean.py":312
+ /* "lxml/html/clean.py":317
* # Something tricky is going on...
* del el.attrib['style']
* elif new != old: # <<<<<<<<<<<<<<
* el.set('style', new)
* if not self.style:
*/
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_new, __pyx_v_old, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 312, __pyx_L1_error)
- __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 312, __pyx_L1_error)
+ __pyx_t_4 = PyObject_RichCompare(__pyx_v_new, __pyx_v_old, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 317, __pyx_L1_error)
+ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 317, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_10) {
- /* "lxml/html/clean.py":313
+ /* "lxml/html/clean.py":318
* del el.attrib['style']
* elif new != old:
* el.set('style', new) # <<<<<<<<<<<<<<
* if not self.style:
* for el in list(doc.iter('style')):
*/
- __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_set); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 313, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_17);
- __pyx_t_6 = NULL;
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_set); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 318, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_13 = NULL;
__pyx_t_7 = 0;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_17);
- if (likely(__pyx_t_6)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
- __Pyx_INCREF(__pyx_t_6);
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
+ if (likely(__pyx_t_13)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+ __Pyx_INCREF(__pyx_t_13);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_17, function);
+ __Pyx_DECREF_SET(__pyx_t_6, function);
__pyx_t_7 = 1;
}
}
#if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_17)) {
- PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_n_s_style, __pyx_v_new};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (PyFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_n_s_style, __pyx_v_new};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else
#endif
#if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
- PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_n_s_style, __pyx_v_new};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_n_s_style, __pyx_v_new};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else
#endif
{
- __pyx_t_13 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 313, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- if (__pyx_t_6) {
- __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_6); __pyx_t_6 = NULL;
+ __pyx_t_17 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 318, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ if (__pyx_t_13) {
+ __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_13); __pyx_t_13 = NULL;
}
__Pyx_INCREF(__pyx_n_s_style);
__Pyx_GIVEREF(__pyx_n_s_style);
- PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_7, __pyx_n_s_style);
+ PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_7, __pyx_n_s_style);
__Pyx_INCREF(__pyx_v_new);
__Pyx_GIVEREF(__pyx_v_new);
- PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_7, __pyx_v_new);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L1_error)
+ PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_7, __pyx_v_new);
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_17, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
}
- __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "lxml/html/clean.py":312
+ /* "lxml/html/clean.py":317
* # Something tricky is going on...
* del el.attrib['style']
* elif new != old: # <<<<<<<<<<<<<<
}
__pyx_L37:;
- /* "lxml/html/clean.py":305
+ /* "lxml/html/clean.py":310
* # from styles, otherwise...
* if not self.inline_style:
* for el in _find_styled_elements(doc): # <<<<<<<<<<<<<<
* old = el.get('style')
- * new = _css_javascript_re.sub('', old)
+ * new = _replace_css_javascript('', old)
*/
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":304
+ /* "lxml/html/clean.py":309
* # If we're deleting style then we don't have to remove JS links
* # from styles, otherwise...
* if not self.inline_style: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":314
+ /* "lxml/html/clean.py":319
* elif new != old:
* el.set('style', new)
* if not self.style: # <<<<<<<<<<<<<<
* for el in list(doc.iter('style')):
* if el.get('type', '').lower().strip() == 'text/javascript':
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 314, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 319, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 314, __pyx_L1_error)
+ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 319, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_11 = ((!__pyx_t_10) != 0);
if (__pyx_t_11) {
- /* "lxml/html/clean.py":315
+ /* "lxml/html/clean.py":320
* el.set('style', new)
* if not self.style:
* for el in list(doc.iter('style')): # <<<<<<<<<<<<<<
* if el.get('type', '').lower().strip() == 'text/javascript':
* el.drop_tree()
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_iter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 315, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_iter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_17 = NULL;
+ __pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
- __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_4);
- if (likely(__pyx_t_17)) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
+ if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
- __Pyx_INCREF(__pyx_t_17);
+ __Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
- __pyx_t_5 = (__pyx_t_17) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_17, __pyx_n_s_style) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_s_style);
- __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 315, __pyx_L1_error)
+ __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_n_s_style) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_s_style);
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 320, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PySequence_List(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 315, __pyx_L1_error)
+ __pyx_t_4 = PySequence_List(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
for (;;) {
if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 315, __pyx_L1_error)
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 320, __pyx_L1_error)
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 315, __pyx_L1_error)
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
#endif
__Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_4);
__pyx_t_4 = 0;
- /* "lxml/html/clean.py":316
+ /* "lxml/html/clean.py":321
* if not self.style:
* for el in list(doc.iter('style')):
* if el.get('type', '').lower().strip() == 'text/javascript': # <<<<<<<<<<<<<<
* el.drop_tree()
* continue
*/
- __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 316, __pyx_L1_error)
+ __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_get); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 321, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 321, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 316, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_lower); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 321, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_lower); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 316, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_13 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) {
+ __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_17);
+ if (likely(__pyx_t_13)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
+ __Pyx_INCREF(__pyx_t_13);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_17, function);
+ }
+ }
+ __pyx_t_6 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_17);
+ __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+ if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 321, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_strip); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 321, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_13);
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_17);
if (likely(__pyx_t_6)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_13, function);
+ __Pyx_DECREF_SET(__pyx_t_17, function);
}
}
- __pyx_t_17 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
+ __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_17);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 316, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_17);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 316, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
- __pyx_t_17 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
- __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_13);
- if (likely(__pyx_t_17)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
- __Pyx_INCREF(__pyx_t_17);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_13, function);
- }
- }
- __pyx_t_4 = (__pyx_t_17) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_17) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
- __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
- if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 316, __pyx_L1_error)
+ if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 321, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_kp_s_text_javascript, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 316, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_kp_s_text_javascript, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 321, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_11) {
- /* "lxml/html/clean.py":317
+ /* "lxml/html/clean.py":322
* for el in list(doc.iter('style')):
* if el.get('type', '').lower().strip() == 'text/javascript':
* el.drop_tree() # <<<<<<<<<<<<<<
* continue
* old = el.text or ''
*/
- __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_drop_tree); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 317, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_17 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
- __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_13);
- if (likely(__pyx_t_17)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
- __Pyx_INCREF(__pyx_t_17);
+ __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_drop_tree); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 322, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_6 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_17);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
+ __Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_13, function);
+ __Pyx_DECREF_SET(__pyx_t_17, function);
}
}
- __pyx_t_4 = (__pyx_t_17) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_17) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
- __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
- if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 317, __pyx_L1_error)
+ __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_17);
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "lxml/html/clean.py":318
+ /* "lxml/html/clean.py":323
* if el.get('type', '').lower().strip() == 'text/javascript':
* el.drop_tree()
* continue # <<<<<<<<<<<<<<
* old = el.text or ''
- * new = _css_javascript_re.sub('', old)
+ * new = _replace_css_javascript('', old)
*/
goto __pyx_L39_continue;
- /* "lxml/html/clean.py":316
+ /* "lxml/html/clean.py":321
* if not self.style:
* for el in list(doc.iter('style')):
* if el.get('type', '').lower().strip() == 'text/javascript': # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":319
+ /* "lxml/html/clean.py":324
* el.drop_tree()
* continue
* old = el.text or '' # <<<<<<<<<<<<<<
- * new = _css_javascript_re.sub('', old)
+ * new = _replace_css_javascript('', old)
* # The imported CSS can do anything; we just can't allow:
*/
- __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_text); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 319, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 319, __pyx_L1_error)
+ __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_text); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 324, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 324, __pyx_L1_error)
if (!__pyx_t_11) {
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
} else {
- __Pyx_INCREF(__pyx_t_13);
- __pyx_t_4 = __pyx_t_13;
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_INCREF(__pyx_t_17);
+ __pyx_t_4 = __pyx_t_17;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
goto __pyx_L42_bool_binop_done;
}
__Pyx_INCREF(__pyx_kp_s__2);
__Pyx_XDECREF_SET(__pyx_v_old, __pyx_t_4);
__pyx_t_4 = 0;
- /* "lxml/html/clean.py":320
+ /* "lxml/html/clean.py":325
* continue
* old = el.text or ''
- * new = _css_javascript_re.sub('', old) # <<<<<<<<<<<<<<
+ * new = _replace_css_javascript('', old) # <<<<<<<<<<<<<<
* # The imported CSS can do anything; we just can't allow:
- * new = _css_import_re.sub('', old)
+ * new = _replace_css_import('', new)
*/
- __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_css_javascript_re); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 320, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_sub); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 320, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_n_s_replace_css_javascript); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 325, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_17);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_13 = NULL;
+ __pyx_t_6 = NULL;
__pyx_t_7 = 0;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
- __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_17);
- if (likely(__pyx_t_13)) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_17);
+ if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
- __Pyx_INCREF(__pyx_t_13);
+ __Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_17, function);
__pyx_t_7 = 1;
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_17)) {
- PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_kp_s__2, __pyx_v_old};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+ PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_kp_s__2, __pyx_v_old};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 325, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
- PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_kp_s__2, __pyx_v_old};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+ PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_kp_s__2, __pyx_v_old};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 325, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else
#endif
{
- __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 320, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (__pyx_t_13) {
- __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_13); __pyx_t_13 = NULL;
+ __pyx_t_13 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 325, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_13);
+ if (__pyx_t_6) {
+ __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_6); __pyx_t_6 = NULL;
}
__Pyx_INCREF(__pyx_kp_s__2);
__Pyx_GIVEREF(__pyx_kp_s__2);
- PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_kp_s__2);
+ PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_7, __pyx_kp_s__2);
__Pyx_INCREF(__pyx_v_old);
__Pyx_GIVEREF(__pyx_v_old);
- PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_v_old);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __pyx_L1_error)
+ PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_7, __pyx_v_old);
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 325, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
}
__Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
__Pyx_XDECREF_SET(__pyx_v_new, __pyx_t_4);
__pyx_t_4 = 0;
- /* "lxml/html/clean.py":322
- * new = _css_javascript_re.sub('', old)
+ /* "lxml/html/clean.py":327
+ * new = _replace_css_javascript('', old)
* # The imported CSS can do anything; we just can't allow:
- * new = _css_import_re.sub('', old) # <<<<<<<<<<<<<<
+ * new = _replace_css_import('', new) # <<<<<<<<<<<<<<
* if self._has_sneaky_javascript(new):
* # Something tricky is going on...
*/
- __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_n_s_css_import_re); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 322, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_n_s_replace_css_import); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 327, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_17);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_sub); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 322, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
- __pyx_t_17 = NULL;
+ __pyx_t_13 = NULL;
__pyx_t_7 = 0;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_6);
- if (likely(__pyx_t_17)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_17);
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
+ __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_17);
+ if (likely(__pyx_t_13)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
+ __Pyx_INCREF(__pyx_t_13);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_6, function);
+ __Pyx_DECREF_SET(__pyx_t_17, function);
__pyx_t_7 = 1;
}
}
#if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[3] = {__pyx_t_17, __pyx_kp_s__2, __pyx_v_old};
- __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
+ if (PyFunction_Check(__pyx_t_17)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_kp_s__2, __pyx_v_new};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 327, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else
#endif
#if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
- PyObject *__pyx_temp[3] = {__pyx_t_17, __pyx_kp_s__2, __pyx_v_old};
- __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_kp_s__2, __pyx_v_new};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 327, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else
#endif
{
- __pyx_t_13 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 322, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- if (__pyx_t_17) {
- __Pyx_GIVEREF(__pyx_t_17); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_17); __pyx_t_17 = NULL;
+ __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 327, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ if (__pyx_t_13) {
+ __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_13); __pyx_t_13 = NULL;
}
__Pyx_INCREF(__pyx_kp_s__2);
__Pyx_GIVEREF(__pyx_kp_s__2);
- PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_7, __pyx_kp_s__2);
- __Pyx_INCREF(__pyx_v_old);
- __Pyx_GIVEREF(__pyx_v_old);
- PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_7, __pyx_v_old);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L1_error)
+ PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_kp_s__2);
+ __Pyx_INCREF(__pyx_v_new);
+ __Pyx_GIVEREF(__pyx_v_new);
+ PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_v_new);
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 327, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
__Pyx_DECREF_SET(__pyx_v_new, __pyx_t_4);
__pyx_t_4 = 0;
- /* "lxml/html/clean.py":323
+ /* "lxml/html/clean.py":328
* # The imported CSS can do anything; we just can't allow:
- * new = _css_import_re.sub('', old)
+ * new = _replace_css_import('', new)
* if self._has_sneaky_javascript(new): # <<<<<<<<<<<<<<
* # Something tricky is going on...
* el.text = '/[inserted by cython to avoid comment start]* deleted *[inserted by cython to avoid comment closer]/'
*/
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_has_sneaky_javascript); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 323, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_13 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
- if (likely(__pyx_t_13)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_13);
+ __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_has_sneaky_javascript); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 328, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_6 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_17);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
+ __Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_6, function);
+ __Pyx_DECREF_SET(__pyx_t_17, function);
}
}
- __pyx_t_4 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_13, __pyx_v_new) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_new);
- __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
- if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error)
+ __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_17, __pyx_t_6, __pyx_v_new) : __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_v_new);
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 328, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 323, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 328, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_11) {
- /* "lxml/html/clean.py":325
+ /* "lxml/html/clean.py":330
* if self._has_sneaky_javascript(new):
* # Something tricky is going on...
* el.text = '/[inserted by cython to avoid comment start]* deleted *[inserted by cython to avoid comment closer]/' # <<<<<<<<<<<<<<
* elif new != old:
* el.text = new
*/
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_text, __pyx_kp_s_deleted) < 0) __PYX_ERR(0, 325, __pyx_L1_error)
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_text, __pyx_kp_s_deleted) < 0) __PYX_ERR(0, 330, __pyx_L1_error)
- /* "lxml/html/clean.py":323
+ /* "lxml/html/clean.py":328
* # The imported CSS can do anything; we just can't allow:
- * new = _css_import_re.sub('', old)
+ * new = _replace_css_import('', new)
* if self._has_sneaky_javascript(new): # <<<<<<<<<<<<<<
* # Something tricky is going on...
* el.text = '/[inserted by cython to avoid comment start]* deleted *[inserted by cython to avoid comment closer]/'
goto __pyx_L44;
}
- /* "lxml/html/clean.py":326
+ /* "lxml/html/clean.py":331
* # Something tricky is going on...
* el.text = '/[inserted by cython to avoid comment start]* deleted *[inserted by cython to avoid comment closer]/'
* elif new != old: # <<<<<<<<<<<<<<
* el.text = new
* if self.comments:
*/
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_new, __pyx_v_old, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 326, __pyx_L1_error)
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 326, __pyx_L1_error)
+ __pyx_t_4 = PyObject_RichCompare(__pyx_v_new, __pyx_v_old, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error)
+ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 331, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_11) {
- /* "lxml/html/clean.py":327
+ /* "lxml/html/clean.py":332
* el.text = '/[inserted by cython to avoid comment start]* deleted *[inserted by cython to avoid comment closer]/'
* elif new != old:
* el.text = new # <<<<<<<<<<<<<<
* if self.comments:
* kill_tags.add(etree.Comment)
*/
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_text, __pyx_v_new) < 0) __PYX_ERR(0, 327, __pyx_L1_error)
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_text, __pyx_v_new) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
- /* "lxml/html/clean.py":326
+ /* "lxml/html/clean.py":331
* # Something tricky is going on...
* el.text = '/[inserted by cython to avoid comment start]* deleted *[inserted by cython to avoid comment closer]/'
* elif new != old: # <<<<<<<<<<<<<<
}
__pyx_L44:;
- /* "lxml/html/clean.py":315
+ /* "lxml/html/clean.py":320
* el.set('style', new)
* if not self.style:
* for el in list(doc.iter('style')): # <<<<<<<<<<<<<<
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":314
+ /* "lxml/html/clean.py":319
* elif new != old:
* el.set('style', new)
* if not self.style: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":291
+ /* "lxml/html/clean.py":296
* if aname not in safe_attrs:
* del attrib[aname]
* if self.javascript: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":328
+ /* "lxml/html/clean.py":333
* elif new != old:
* el.text = new
* if self.comments: # <<<<<<<<<<<<<<
* kill_tags.add(etree.Comment)
* if self.processing_instructions:
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_comments); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 328, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_comments); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 333, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 328, __pyx_L1_error)
+ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 333, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_11) {
- /* "lxml/html/clean.py":329
+ /* "lxml/html/clean.py":334
* el.text = new
* if self.comments:
* kill_tags.add(etree.Comment) # <<<<<<<<<<<<<<
* if self.processing_instructions:
* kill_tags.add(etree.ProcessingInstruction)
*/
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_etree); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 329, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_etree); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 334, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_Comment); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 329, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_Comment); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 334, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_12 = PySet_Add(__pyx_v_kill_tags, __pyx_t_4); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 329, __pyx_L1_error)
+ __pyx_t_12 = PySet_Add(__pyx_v_kill_tags, __pyx_t_4); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 334, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "lxml/html/clean.py":328
+ /* "lxml/html/clean.py":333
* elif new != old:
* el.text = new
* if self.comments: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":330
+ /* "lxml/html/clean.py":335
* if self.comments:
* kill_tags.add(etree.Comment)
* if self.processing_instructions: # <<<<<<<<<<<<<<
* kill_tags.add(etree.ProcessingInstruction)
* if self.style:
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_processing_instructions); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 330, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_processing_instructions); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 335, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 330, __pyx_L1_error)
+ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 335, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_11) {
- /* "lxml/html/clean.py":331
+ /* "lxml/html/clean.py":336
* kill_tags.add(etree.Comment)
* if self.processing_instructions:
* kill_tags.add(etree.ProcessingInstruction) # <<<<<<<<<<<<<<
* if self.style:
* kill_tags.add('style')
*/
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_etree); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_etree); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 336, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ProcessingInstruction); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 331, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ProcessingInstruction); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_12 = PySet_Add(__pyx_v_kill_tags, __pyx_t_5); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 331, __pyx_L1_error)
+ __pyx_t_12 = PySet_Add(__pyx_v_kill_tags, __pyx_t_5); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 336, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":330
+ /* "lxml/html/clean.py":335
* if self.comments:
* kill_tags.add(etree.Comment)
* if self.processing_instructions: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":332
+ /* "lxml/html/clean.py":337
* if self.processing_instructions:
* kill_tags.add(etree.ProcessingInstruction)
* if self.style: # <<<<<<<<<<<<<<
* kill_tags.add('style')
* if self.inline_style:
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 332, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 337, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 332, __pyx_L1_error)
+ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 337, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_11) {
- /* "lxml/html/clean.py":333
+ /* "lxml/html/clean.py":338
* kill_tags.add(etree.ProcessingInstruction)
* if self.style:
* kill_tags.add('style') # <<<<<<<<<<<<<<
* if self.inline_style:
* etree.strip_attributes(doc, 'style')
*/
- __pyx_t_12 = PySet_Add(__pyx_v_kill_tags, __pyx_n_s_style); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 333, __pyx_L1_error)
+ __pyx_t_12 = PySet_Add(__pyx_v_kill_tags, __pyx_n_s_style); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 338, __pyx_L1_error)
- /* "lxml/html/clean.py":332
+ /* "lxml/html/clean.py":337
* if self.processing_instructions:
* kill_tags.add(etree.ProcessingInstruction)
* if self.style: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":334
+ /* "lxml/html/clean.py":339
* if self.style:
* kill_tags.add('style')
* if self.inline_style: # <<<<<<<<<<<<<<
* etree.strip_attributes(doc, 'style')
* if self.links:
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_inline_style); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 334, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_inline_style); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 339, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 334, __pyx_L1_error)
+ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 339, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_11) {
- /* "lxml/html/clean.py":335
+ /* "lxml/html/clean.py":340
* kill_tags.add('style')
* if self.inline_style:
* etree.strip_attributes(doc, 'style') # <<<<<<<<<<<<<<
* if self.links:
* kill_tags.add('link')
*/
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_etree); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 335, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_etree); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 340, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strip_attributes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 335, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strip_attributes); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 340, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
__pyx_t_7 = 0;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_17);
if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_6, function);
+ __Pyx_DECREF_SET(__pyx_t_17, function);
__pyx_t_7 = 1;
}
}
#if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_6)) {
+ if (PyFunction_Check(__pyx_t_17)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_doc, __pyx_n_s_style};
- __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 335, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 340, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
#if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_doc, __pyx_n_s_style};
- __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 335, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 340, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
{
- __pyx_t_13 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 335, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 340, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
if (__pyx_t_4) {
- __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
}
__Pyx_INCREF(__pyx_v_doc);
__Pyx_GIVEREF(__pyx_v_doc);
- PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_7, __pyx_v_doc);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_v_doc);
__Pyx_INCREF(__pyx_n_s_style);
__Pyx_GIVEREF(__pyx_n_s_style);
- PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_7, __pyx_n_s_style);
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_13, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 335, __pyx_L1_error)
+ PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_n_s_style);
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 340, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":334
+ /* "lxml/html/clean.py":339
* if self.style:
* kill_tags.add('style')
* if self.inline_style: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":336
+ /* "lxml/html/clean.py":341
* if self.inline_style:
* etree.strip_attributes(doc, 'style')
* if self.links: # <<<<<<<<<<<<<<
* kill_tags.add('link')
* elif self.style or self.javascript:
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_links); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_links); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 341, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 336, __pyx_L1_error)
+ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 341, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_11) {
- /* "lxml/html/clean.py":337
+ /* "lxml/html/clean.py":342
* etree.strip_attributes(doc, 'style')
* if self.links:
* kill_tags.add('link') # <<<<<<<<<<<<<<
* elif self.style or self.javascript:
* # We must get rid of included stylesheets if Javascript is not
*/
- __pyx_t_12 = PySet_Add(__pyx_v_kill_tags, __pyx_n_s_link); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 337, __pyx_L1_error)
+ __pyx_t_12 = PySet_Add(__pyx_v_kill_tags, __pyx_n_s_link); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 342, __pyx_L1_error)
- /* "lxml/html/clean.py":336
+ /* "lxml/html/clean.py":341
* if self.inline_style:
* etree.strip_attributes(doc, 'style')
* if self.links: # <<<<<<<<<<<<<<
goto __pyx_L49;
}
- /* "lxml/html/clean.py":338
+ /* "lxml/html/clean.py":343
* if self.links:
* kill_tags.add('link')
* elif self.style or self.javascript: # <<<<<<<<<<<<<<
* # We must get rid of included stylesheets if Javascript is not
* # allowed, as you can put Javascript in them
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 338, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 343, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 338, __pyx_L1_error)
+ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 343, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (!__pyx_t_10) {
} else {
__pyx_t_11 = __pyx_t_10;
goto __pyx_L50_bool_binop_done;
}
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_javascript); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 338, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_javascript); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 343, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 338, __pyx_L1_error)
+ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 343, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_11 = __pyx_t_10;
__pyx_L50_bool_binop_done:;
if (__pyx_t_11) {
- /* "lxml/html/clean.py":341
+ /* "lxml/html/clean.py":346
* # We must get rid of included stylesheets if Javascript is not
* # allowed, as you can put Javascript in them
* for el in list(doc.iter('link')): # <<<<<<<<<<<<<<
* if 'stylesheet' in el.get('rel', '').lower():
* # Note this kills alternate stylesheets as well
*/
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_iter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 341, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_13 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
- if (likely(__pyx_t_13)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_13);
+ __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_iter); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 346, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_6 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_17);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
+ __Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_6, function);
+ __Pyx_DECREF_SET(__pyx_t_17, function);
}
}
- __pyx_t_5 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_13, __pyx_n_s_link) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_n_s_link);
- __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 341, __pyx_L1_error)
+ __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_17, __pyx_t_6, __pyx_n_s_link) : __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_n_s_link);
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 346, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PySequence_List(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 341, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __pyx_t_17 = PySequence_List(__pyx_t_5); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 346, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_5 = __pyx_t_17; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
for (;;) {
if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 341, __pyx_L1_error)
+ __pyx_t_17 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_17); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 346, __pyx_L1_error)
#else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 341, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_17 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 346, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
#endif
- __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_6);
- __pyx_t_6 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_17);
+ __pyx_t_17 = 0;
- /* "lxml/html/clean.py":342
+ /* "lxml/html/clean.py":347
* # allowed, as you can put Javascript in them
* for el in list(doc.iter('link')):
* if 'stylesheet' in el.get('rel', '').lower(): # <<<<<<<<<<<<<<
* # Note this kills alternate stylesheets as well
* if not self.allow_element(el):
*/
- __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 342, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 342, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 347, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 347, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_lower); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 342, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_lower); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 347, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13);
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_13, function);
+ __Pyx_DECREF_SET(__pyx_t_6, function);
}
}
- __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
+ __pyx_t_17 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 342, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_11 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_stylesheet, __pyx_t_6, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 342, __pyx_L1_error)
+ if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 347, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_11 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_stylesheet, __pyx_t_17, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 347, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
__pyx_t_10 = (__pyx_t_11 != 0);
if (__pyx_t_10) {
- /* "lxml/html/clean.py":344
+ /* "lxml/html/clean.py":349
* if 'stylesheet' in el.get('rel', '').lower():
* # Note this kills alternate stylesheets as well
* if not self.allow_element(el): # <<<<<<<<<<<<<<
* el.drop_tree()
* if self.meta:
*/
- __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_allow_element); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 344, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_allow_element); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 349, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
__pyx_t_4 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13);
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_13, function);
+ __Pyx_DECREF_SET(__pyx_t_6, function);
}
}
- __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_4, __pyx_v_el) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_v_el);
+ __pyx_t_17 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_v_el) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_el);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 344, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 344, __pyx_L1_error)
+ if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 349, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 349, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
__pyx_t_11 = ((!__pyx_t_10) != 0);
if (__pyx_t_11) {
- /* "lxml/html/clean.py":345
+ /* "lxml/html/clean.py":350
* # Note this kills alternate stylesheets as well
* if not self.allow_element(el):
* el.drop_tree() # <<<<<<<<<<<<<<
* if self.meta:
* kill_tags.add('meta')
*/
- __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_drop_tree); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 345, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_drop_tree); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 350, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
__pyx_t_4 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13);
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_13, function);
+ __Pyx_DECREF_SET(__pyx_t_6, function);
}
}
- __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
+ __pyx_t_17 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 345, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 350, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
- /* "lxml/html/clean.py":344
+ /* "lxml/html/clean.py":349
* if 'stylesheet' in el.get('rel', '').lower():
* # Note this kills alternate stylesheets as well
* if not self.allow_element(el): # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":342
+ /* "lxml/html/clean.py":347
* # allowed, as you can put Javascript in them
* for el in list(doc.iter('link')):
* if 'stylesheet' in el.get('rel', '').lower(): # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":341
+ /* "lxml/html/clean.py":346
* # We must get rid of included stylesheets if Javascript is not
* # allowed, as you can put Javascript in them
* for el in list(doc.iter('link')): # <<<<<<<<<<<<<<
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":338
+ /* "lxml/html/clean.py":343
* if self.links:
* kill_tags.add('link')
* elif self.style or self.javascript: # <<<<<<<<<<<<<<
}
__pyx_L49:;
- /* "lxml/html/clean.py":346
+ /* "lxml/html/clean.py":351
* if not self.allow_element(el):
* el.drop_tree()
* if self.meta: # <<<<<<<<<<<<<<
* kill_tags.add('meta')
* if self.page_structure:
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_meta); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 346, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_meta); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 351, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 346, __pyx_L1_error)
+ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 351, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_11) {
- /* "lxml/html/clean.py":347
+ /* "lxml/html/clean.py":352
* el.drop_tree()
* if self.meta:
* kill_tags.add('meta') # <<<<<<<<<<<<<<
* if self.page_structure:
* remove_tags.update(('head', 'html', 'title'))
*/
- __pyx_t_12 = PySet_Add(__pyx_v_kill_tags, __pyx_n_s_meta); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 347, __pyx_L1_error)
+ __pyx_t_12 = PySet_Add(__pyx_v_kill_tags, __pyx_n_s_meta); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 352, __pyx_L1_error)
- /* "lxml/html/clean.py":346
+ /* "lxml/html/clean.py":351
* if not self.allow_element(el):
* el.drop_tree()
* if self.meta: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":348
+ /* "lxml/html/clean.py":353
* if self.meta:
* kill_tags.add('meta')
* if self.page_structure: # <<<<<<<<<<<<<<
* remove_tags.update(('head', 'html', 'title'))
* if self.embedded:
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_page_structure); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 348, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_page_structure); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 353, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 348, __pyx_L1_error)
+ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 353, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_11) {
- /* "lxml/html/clean.py":349
+ /* "lxml/html/clean.py":354
* kill_tags.add('meta')
* if self.page_structure:
* remove_tags.update(('head', 'html', 'title')) # <<<<<<<<<<<<<<
* if self.embedded:
* # FIXME: is <layer> really embedded?
*/
- __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_update, __pyx_v_remove_tags, __pyx_tuple__5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 349, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_update, __pyx_v_remove_tags, __pyx_tuple__5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 354, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":348
+ /* "lxml/html/clean.py":353
* if self.meta:
* kill_tags.add('meta')
* if self.page_structure: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":350
+ /* "lxml/html/clean.py":355
* if self.page_structure:
* remove_tags.update(('head', 'html', 'title'))
* if self.embedded: # <<<<<<<<<<<<<<
* # FIXME: is <layer> really embedded?
* # We should get rid of any <param> tags not inside <applet>;
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_embedded); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 350, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_embedded); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 355, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 350, __pyx_L1_error)
+ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 355, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_11) {
- /* "lxml/html/clean.py":354
+ /* "lxml/html/clean.py":359
* # We should get rid of any <param> tags not inside <applet>;
* # These are not really valid anyway.
* for el in list(doc.iter('param')): # <<<<<<<<<<<<<<
* parent = el.getparent()
* while parent is not None and parent.tag not in ('applet', 'object'):
*/
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_iter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 354, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_13 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
- if (likely(__pyx_t_13)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_13);
+ __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_iter); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 359, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_6 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_17);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
+ __Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_6, function);
+ __Pyx_DECREF_SET(__pyx_t_17, function);
}
}
- __pyx_t_5 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_13, __pyx_n_s_param) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_n_s_param);
- __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 354, __pyx_L1_error)
+ __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_17, __pyx_t_6, __pyx_n_s_param) : __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_n_s_param);
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 359, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PySequence_List(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 354, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __pyx_t_17 = PySequence_List(__pyx_t_5); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 359, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_5 = __pyx_t_17; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
for (;;) {
if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 354, __pyx_L1_error)
+ __pyx_t_17 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_17); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 359, __pyx_L1_error)
#else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 354, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_17 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 359, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
#endif
- __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_6);
- __pyx_t_6 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_17);
+ __pyx_t_17 = 0;
- /* "lxml/html/clean.py":355
+ /* "lxml/html/clean.py":360
* # These are not really valid anyway.
* for el in list(doc.iter('param')):
* parent = el.getparent() # <<<<<<<<<<<<<<
* while parent is not None and parent.tag not in ('applet', 'object'):
* parent = parent.getparent()
*/
- __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_getparent); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 355, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_getparent); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 360, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
__pyx_t_4 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13);
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_13, function);
+ __Pyx_DECREF_SET(__pyx_t_6, function);
}
}
- __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
+ __pyx_t_17 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 355, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __Pyx_XDECREF_SET(__pyx_v_parent, __pyx_t_6);
- __pyx_t_6 = 0;
+ if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 360, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_parent, __pyx_t_17);
+ __pyx_t_17 = 0;
- /* "lxml/html/clean.py":356
+ /* "lxml/html/clean.py":361
* for el in list(doc.iter('param')):
* parent = el.getparent()
* while parent is not None and parent.tag not in ('applet', 'object'): # <<<<<<<<<<<<<<
__pyx_t_11 = __pyx_t_18;
goto __pyx_L63_bool_binop_done;
}
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_tag); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 356, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_applet, Py_NE)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 356, __pyx_L1_error)
+ __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_tag); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 361, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_t_17, __pyx_n_s_applet, Py_NE)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 361, __pyx_L1_error)
if (__pyx_t_10) {
} else {
__pyx_t_18 = __pyx_t_10;
goto __pyx_L65_bool_binop_done;
}
- __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_object, Py_NE)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 356, __pyx_L1_error)
+ __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_t_17, __pyx_n_s_object, Py_NE)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 361, __pyx_L1_error)
__pyx_t_18 = __pyx_t_10;
__pyx_L65_bool_binop_done:;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
__pyx_t_10 = (__pyx_t_18 != 0);
__pyx_t_11 = __pyx_t_10;
__pyx_L63_bool_binop_done:;
if (!__pyx_t_11) break;
- /* "lxml/html/clean.py":357
+ /* "lxml/html/clean.py":362
* parent = el.getparent()
* while parent is not None and parent.tag not in ('applet', 'object'):
* parent = parent.getparent() # <<<<<<<<<<<<<<
* if parent is None:
* el.drop_tree()
*/
- __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_getparent); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 357, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_getparent); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 362, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
__pyx_t_4 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13);
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_13, function);
+ __Pyx_DECREF_SET(__pyx_t_6, function);
}
}
- __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
+ __pyx_t_17 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 357, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __Pyx_DECREF_SET(__pyx_v_parent, __pyx_t_6);
- __pyx_t_6 = 0;
+ if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 362, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF_SET(__pyx_v_parent, __pyx_t_17);
+ __pyx_t_17 = 0;
}
- /* "lxml/html/clean.py":358
+ /* "lxml/html/clean.py":363
* while parent is not None and parent.tag not in ('applet', 'object'):
* parent = parent.getparent()
* if parent is None: # <<<<<<<<<<<<<<
__pyx_t_10 = (__pyx_t_11 != 0);
if (__pyx_t_10) {
- /* "lxml/html/clean.py":359
+ /* "lxml/html/clean.py":364
* parent = parent.getparent()
* if parent is None:
* el.drop_tree() # <<<<<<<<<<<<<<
* kill_tags.update(('applet',))
* # The alternate contents that are in an iframe are a good fallback:
*/
- __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_drop_tree); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 359, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_drop_tree); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 364, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
__pyx_t_4 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13);
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_13, function);
+ __Pyx_DECREF_SET(__pyx_t_6, function);
}
}
- __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
+ __pyx_t_17 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 359, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 364, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
- /* "lxml/html/clean.py":358
+ /* "lxml/html/clean.py":363
* while parent is not None and parent.tag not in ('applet', 'object'):
* parent = parent.getparent()
* if parent is None: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":354
+ /* "lxml/html/clean.py":359
* # We should get rid of any <param> tags not inside <applet>;
* # These are not really valid anyway.
* for el in list(doc.iter('param')): # <<<<<<<<<<<<<<
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":360
+ /* "lxml/html/clean.py":365
* if parent is None:
* el.drop_tree()
* kill_tags.update(('applet',)) # <<<<<<<<<<<<<<
* # The alternate contents that are in an iframe are a good fallback:
* remove_tags.update(('iframe', 'embed', 'layer', 'object', 'param'))
*/
- __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_update, __pyx_v_kill_tags, __pyx_tuple__6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 360, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_update, __pyx_v_kill_tags, __pyx_tuple__6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 365, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":362
+ /* "lxml/html/clean.py":367
* kill_tags.update(('applet',))
* # The alternate contents that are in an iframe are a good fallback:
* remove_tags.update(('iframe', 'embed', 'layer', 'object', 'param')) # <<<<<<<<<<<<<<
* if self.frames:
* # FIXME: ideally we should look at the frame links, but
*/
- __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_update, __pyx_v_remove_tags, __pyx_tuple__7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 362, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_update, __pyx_v_remove_tags, __pyx_tuple__7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 367, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":350
+ /* "lxml/html/clean.py":355
* if self.page_structure:
* remove_tags.update(('head', 'html', 'title'))
* if self.embedded: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":363
+ /* "lxml/html/clean.py":368
* # The alternate contents that are in an iframe are a good fallback:
* remove_tags.update(('iframe', 'embed', 'layer', 'object', 'param'))
* if self.frames: # <<<<<<<<<<<<<<
* # FIXME: ideally we should look at the frame links, but
* # generally frames don't mix properly with an HTML
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_frames); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 363, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_frames); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 368, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 363, __pyx_L1_error)
+ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 368, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_10) {
- /* "lxml/html/clean.py":367
+ /* "lxml/html/clean.py":372
* # generally frames don't mix properly with an HTML
* # fragment anyway.
* kill_tags.update(defs.frame_tags) # <<<<<<<<<<<<<<
* if self.forms:
* remove_tags.add('form')
*/
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_defs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 367, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_defs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 372, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_frame_tags); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 367, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_frame_tags); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 372, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_update, __pyx_v_kill_tags, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 367, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_update, __pyx_v_kill_tags, __pyx_t_17); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 372, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":363
+ /* "lxml/html/clean.py":368
* # The alternate contents that are in an iframe are a good fallback:
* remove_tags.update(('iframe', 'embed', 'layer', 'object', 'param'))
* if self.frames: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":368
+ /* "lxml/html/clean.py":373
* # fragment anyway.
* kill_tags.update(defs.frame_tags)
* if self.forms: # <<<<<<<<<<<<<<
* remove_tags.add('form')
* kill_tags.update(('button', 'input', 'select', 'textarea'))
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_forms); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 368, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_forms); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 373, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 368, __pyx_L1_error)
+ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 373, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_10) {
- /* "lxml/html/clean.py":369
+ /* "lxml/html/clean.py":374
* kill_tags.update(defs.frame_tags)
* if self.forms:
* remove_tags.add('form') # <<<<<<<<<<<<<<
* kill_tags.update(('button', 'input', 'select', 'textarea'))
* if self.annoying_tags:
*/
- __pyx_t_12 = PySet_Add(__pyx_v_remove_tags, __pyx_n_s_form); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 369, __pyx_L1_error)
+ __pyx_t_12 = PySet_Add(__pyx_v_remove_tags, __pyx_n_s_form); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 374, __pyx_L1_error)
- /* "lxml/html/clean.py":370
+ /* "lxml/html/clean.py":375
* if self.forms:
* remove_tags.add('form')
* kill_tags.update(('button', 'input', 'select', 'textarea')) # <<<<<<<<<<<<<<
* if self.annoying_tags:
* remove_tags.update(('blink', 'marquee'))
*/
- __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_update, __pyx_v_kill_tags, __pyx_tuple__8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 370, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_update, __pyx_v_kill_tags, __pyx_tuple__8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 375, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":368
+ /* "lxml/html/clean.py":373
* # fragment anyway.
* kill_tags.update(defs.frame_tags)
* if self.forms: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":371
+ /* "lxml/html/clean.py":376
* remove_tags.add('form')
* kill_tags.update(('button', 'input', 'select', 'textarea'))
* if self.annoying_tags: # <<<<<<<<<<<<<<
* remove_tags.update(('blink', 'marquee'))
*
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_annoying_tags); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 371, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_annoying_tags); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 376, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 371, __pyx_L1_error)
+ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 376, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_10) {
- /* "lxml/html/clean.py":372
+ /* "lxml/html/clean.py":377
* kill_tags.update(('button', 'input', 'select', 'textarea'))
* if self.annoying_tags:
* remove_tags.update(('blink', 'marquee')) # <<<<<<<<<<<<<<
*
* _remove = []
*/
- __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_update, __pyx_v_remove_tags, __pyx_tuple__9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 372, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_update, __pyx_v_remove_tags, __pyx_tuple__9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 377, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":371
+ /* "lxml/html/clean.py":376
* remove_tags.add('form')
* kill_tags.update(('button', 'input', 'select', 'textarea'))
* if self.annoying_tags: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":374
+ /* "lxml/html/clean.py":379
* remove_tags.update(('blink', 'marquee'))
*
* _remove = [] # <<<<<<<<<<<<<<
* _kill = []
* for el in doc.iter():
*/
- __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 374, __pyx_L1_error)
+ __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 379, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_v__remove = ((PyObject*)__pyx_t_5);
__pyx_t_5 = 0;
- /* "lxml/html/clean.py":375
+ /* "lxml/html/clean.py":380
*
* _remove = []
* _kill = [] # <<<<<<<<<<<<<<
* for el in doc.iter():
* if el.tag in kill_tags:
*/
- __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 375, __pyx_L1_error)
+ __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 380, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_v__kill = ((PyObject*)__pyx_t_5);
__pyx_t_5 = 0;
- /* "lxml/html/clean.py":376
+ /* "lxml/html/clean.py":381
* _remove = []
* _kill = []
* for el in doc.iter(): # <<<<<<<<<<<<<<
* if el.tag in kill_tags:
* if self.allow_element(el):
*/
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_iter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 376, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_13 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
- if (likely(__pyx_t_13)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_13);
+ __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_iter); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 381, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_6 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_17);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
+ __Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_6, function);
+ __Pyx_DECREF_SET(__pyx_t_17, function);
}
}
- __pyx_t_5 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 376, __pyx_L1_error)
+ __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_17);
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 381, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
- __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0;
+ __pyx_t_17 = __pyx_t_5; __Pyx_INCREF(__pyx_t_17); __pyx_t_8 = 0;
__pyx_t_9 = NULL;
} else {
- __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 376, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 376, __pyx_L1_error)
+ __pyx_t_8 = -1; __pyx_t_17 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 381, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_9 = Py_TYPE(__pyx_t_17)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 381, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
for (;;) {
if (likely(!__pyx_t_9)) {
- if (likely(PyList_CheckExact(__pyx_t_6))) {
- if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break;
+ if (likely(PyList_CheckExact(__pyx_t_17))) {
+ if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_17)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 376, __pyx_L1_error)
+ __pyx_t_5 = PyList_GET_ITEM(__pyx_t_17, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 381, __pyx_L1_error)
#else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 376, __pyx_L1_error)
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_17, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 381, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
#endif
} else {
- if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
+ if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_17)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 376, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_17, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 381, __pyx_L1_error)
#else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 376, __pyx_L1_error)
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_17, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 381, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
#endif
}
} else {
- __pyx_t_5 = __pyx_t_9(__pyx_t_6);
+ __pyx_t_5 = __pyx_t_9(__pyx_t_17);
if (unlikely(!__pyx_t_5)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 376, __pyx_L1_error)
+ else __PYX_ERR(0, 381, __pyx_L1_error)
}
break;
}
__Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_5);
__pyx_t_5 = 0;
- /* "lxml/html/clean.py":377
+ /* "lxml/html/clean.py":382
* _kill = []
* for el in doc.iter():
* if el.tag in kill_tags: # <<<<<<<<<<<<<<
* if self.allow_element(el):
* continue
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 377, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 382, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_10 = (__Pyx_PySet_ContainsTF(__pyx_t_5, __pyx_v_kill_tags, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 377, __pyx_L1_error)
+ __pyx_t_10 = (__Pyx_PySet_ContainsTF(__pyx_t_5, __pyx_v_kill_tags, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 382, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_11 = (__pyx_t_10 != 0);
if (__pyx_t_11) {
- /* "lxml/html/clean.py":378
+ /* "lxml/html/clean.py":383
* for el in doc.iter():
* if el.tag in kill_tags:
* if self.allow_element(el): # <<<<<<<<<<<<<<
* continue
* _kill.append(el)
*/
- __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_allow_element); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 378, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_allow_element); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
__pyx_t_4 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13);
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_13, function);
+ __Pyx_DECREF_SET(__pyx_t_6, function);
}
}
- __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_4, __pyx_v_el) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_v_el);
+ __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_v_el) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_el);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 378, __pyx_L1_error)
+ if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 383, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 378, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 383, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_11) {
- /* "lxml/html/clean.py":379
+ /* "lxml/html/clean.py":384
* if el.tag in kill_tags:
* if self.allow_element(el):
* continue # <<<<<<<<<<<<<<
*/
goto __pyx_L71_continue;
- /* "lxml/html/clean.py":378
+ /* "lxml/html/clean.py":383
* for el in doc.iter():
* if el.tag in kill_tags:
* if self.allow_element(el): # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":380
+ /* "lxml/html/clean.py":385
* if self.allow_element(el):
* continue
* _kill.append(el) # <<<<<<<<<<<<<<
* elif el.tag in remove_tags:
* if self.allow_element(el):
*/
- __pyx_t_12 = __Pyx_PyList_Append(__pyx_v__kill, __pyx_v_el); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 380, __pyx_L1_error)
+ __pyx_t_12 = __Pyx_PyList_Append(__pyx_v__kill, __pyx_v_el); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 385, __pyx_L1_error)
- /* "lxml/html/clean.py":377
+ /* "lxml/html/clean.py":382
* _kill = []
* for el in doc.iter():
* if el.tag in kill_tags: # <<<<<<<<<<<<<<
goto __pyx_L73;
}
- /* "lxml/html/clean.py":381
+ /* "lxml/html/clean.py":386
* continue
* _kill.append(el)
* elif el.tag in remove_tags: # <<<<<<<<<<<<<<
* if self.allow_element(el):
* continue
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 381, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 386, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_11 = (__Pyx_PySet_ContainsTF(__pyx_t_5, __pyx_v_remove_tags, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 381, __pyx_L1_error)
+ __pyx_t_11 = (__Pyx_PySet_ContainsTF(__pyx_t_5, __pyx_v_remove_tags, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 386, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_10 = (__pyx_t_11 != 0);
if (__pyx_t_10) {
- /* "lxml/html/clean.py":382
+ /* "lxml/html/clean.py":387
* _kill.append(el)
* elif el.tag in remove_tags:
* if self.allow_element(el): # <<<<<<<<<<<<<<
* continue
* _remove.append(el)
*/
- __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_allow_element); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 382, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_allow_element); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 387, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
__pyx_t_4 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13);
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_13, function);
+ __Pyx_DECREF_SET(__pyx_t_6, function);
}
}
- __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_4, __pyx_v_el) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_v_el);
+ __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_v_el) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_el);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 382, __pyx_L1_error)
+ if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 382, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 387, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_10) {
- /* "lxml/html/clean.py":383
+ /* "lxml/html/clean.py":388
* elif el.tag in remove_tags:
* if self.allow_element(el):
* continue # <<<<<<<<<<<<<<
*/
goto __pyx_L71_continue;
- /* "lxml/html/clean.py":382
+ /* "lxml/html/clean.py":387
* _kill.append(el)
* elif el.tag in remove_tags:
* if self.allow_element(el): # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":384
+ /* "lxml/html/clean.py":389
* if self.allow_element(el):
* continue
* _remove.append(el) # <<<<<<<<<<<<<<
*
* if _remove and _remove[0] == doc:
*/
- __pyx_t_12 = __Pyx_PyList_Append(__pyx_v__remove, __pyx_v_el); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 384, __pyx_L1_error)
+ __pyx_t_12 = __Pyx_PyList_Append(__pyx_v__remove, __pyx_v_el); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 389, __pyx_L1_error)
- /* "lxml/html/clean.py":381
+ /* "lxml/html/clean.py":386
* continue
* _kill.append(el)
* elif el.tag in remove_tags: # <<<<<<<<<<<<<<
}
__pyx_L73:;
- /* "lxml/html/clean.py":376
+ /* "lxml/html/clean.py":381
* _remove = []
* _kill = []
* for el in doc.iter(): # <<<<<<<<<<<<<<
*/
__pyx_L71_continue:;
}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
- /* "lxml/html/clean.py":386
+ /* "lxml/html/clean.py":391
* _remove.append(el)
*
* if _remove and _remove[0] == doc: # <<<<<<<<<<<<<<
__pyx_t_10 = __pyx_t_11;
goto __pyx_L77_bool_binop_done;
}
- __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v__remove, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 386, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_v_doc, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 386, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 386, __pyx_L1_error)
+ __pyx_t_17 = __Pyx_GetItemInt_List(__pyx_v__remove, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 391, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_5 = PyObject_RichCompare(__pyx_t_17, __pyx_v_doc, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 391, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 391, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_10 = __pyx_t_11;
__pyx_L77_bool_binop_done:;
if (__pyx_t_10) {
- /* "lxml/html/clean.py":389
+ /* "lxml/html/clean.py":394
* # We have to drop the parent-most tag, which we can't
* # do. Instead we'll rewrite it:
* el = _remove.pop(0) # <<<<<<<<<<<<<<
* el.tag = 'div'
* el.attrib.clear()
*/
- __pyx_t_5 = __Pyx_PyList_PopIndex(__pyx_v__remove, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 389, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyList_PopIndex(__pyx_v__remove, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 394, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_5);
__pyx_t_5 = 0;
- /* "lxml/html/clean.py":390
+ /* "lxml/html/clean.py":395
* # do. Instead we'll rewrite it:
* el = _remove.pop(0)
* el.tag = 'div' # <<<<<<<<<<<<<<
* el.attrib.clear()
* elif _kill and _kill[0] == doc:
*/
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_tag, __pyx_n_s_div) < 0) __PYX_ERR(0, 390, __pyx_L1_error)
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_tag, __pyx_n_s_div) < 0) __PYX_ERR(0, 395, __pyx_L1_error)
- /* "lxml/html/clean.py":391
+ /* "lxml/html/clean.py":396
* el = _remove.pop(0)
* el.tag = 'div'
* el.attrib.clear() # <<<<<<<<<<<<<<
* elif _kill and _kill[0] == doc:
* # We have to drop the parent-most element, which we can't
*/
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_attrib); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 391, __pyx_L1_error)
+ __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_attrib); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 396, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_clear); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 396, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_clear); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 391, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_13);
- if (likely(__pyx_t_6)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
- __Pyx_INCREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __pyx_t_17 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_6);
+ if (likely(__pyx_t_17)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+ __Pyx_INCREF(__pyx_t_17);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_13, function);
+ __Pyx_DECREF_SET(__pyx_t_6, function);
}
}
- __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 391, __pyx_L1_error)
+ __pyx_t_5 = (__pyx_t_17) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_17) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
+ if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 396, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":386
+ /* "lxml/html/clean.py":391
* _remove.append(el)
*
* if _remove and _remove[0] == doc: # <<<<<<<<<<<<<<
goto __pyx_L76;
}
- /* "lxml/html/clean.py":392
+ /* "lxml/html/clean.py":397
* el.tag = 'div'
* el.attrib.clear()
* elif _kill and _kill[0] == doc: # <<<<<<<<<<<<<<
__pyx_t_10 = __pyx_t_11;
goto __pyx_L79_bool_binop_done;
}
- __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v__kill, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 392, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v__kill, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 397, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_13 = PyObject_RichCompare(__pyx_t_5, __pyx_v_doc, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 392, __pyx_L1_error)
+ __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_v_doc, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 397, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 392, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 397, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_10 = __pyx_t_11;
__pyx_L79_bool_binop_done:;
if (__pyx_t_10) {
- /* "lxml/html/clean.py":395
+ /* "lxml/html/clean.py":400
* # We have to drop the parent-most element, which we can't
* # do. Instead we'll clear it:
* el = _kill.pop(0) # <<<<<<<<<<<<<<
* if el.tag != 'html':
* el.tag = 'div'
*/
- __pyx_t_13 = __Pyx_PyList_PopIndex(__pyx_v__kill, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 395, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_13);
- __pyx_t_13 = 0;
+ __pyx_t_6 = __Pyx_PyList_PopIndex(__pyx_v__kill, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 400, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_6);
+ __pyx_t_6 = 0;
- /* "lxml/html/clean.py":396
+ /* "lxml/html/clean.py":401
* # do. Instead we'll clear it:
* el = _kill.pop(0)
* if el.tag != 'html': # <<<<<<<<<<<<<<
* el.tag = 'div'
* el.clear()
*/
- __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 396, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_t_13, __pyx_n_s_html, Py_NE)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 396, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 401, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_html, Py_NE)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 401, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_10) {
- /* "lxml/html/clean.py":397
+ /* "lxml/html/clean.py":402
* el = _kill.pop(0)
* if el.tag != 'html':
* el.tag = 'div' # <<<<<<<<<<<<<<
* el.clear()
*
*/
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_tag, __pyx_n_s_div) < 0) __PYX_ERR(0, 397, __pyx_L1_error)
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_tag, __pyx_n_s_div) < 0) __PYX_ERR(0, 402, __pyx_L1_error)
- /* "lxml/html/clean.py":396
+ /* "lxml/html/clean.py":401
* # do. Instead we'll clear it:
* el = _kill.pop(0)
* if el.tag != 'html': # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":398
+ /* "lxml/html/clean.py":403
* if el.tag != 'html':
* el.tag = 'div'
* el.clear() # <<<<<<<<<<<<<<
*
* _kill.reverse() # start with innermost tags
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_clear); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 398, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_clear); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 403, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = NULL;
+ __pyx_t_17 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_6)) {
+ __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_17)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_6);
+ __Pyx_INCREF(__pyx_t_17);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
- __pyx_t_13 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 398, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_6 = (__pyx_t_17) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_17) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
+ if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 403, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "lxml/html/clean.py":392
+ /* "lxml/html/clean.py":397
* el.tag = 'div'
* el.attrib.clear()
* elif _kill and _kill[0] == doc: # <<<<<<<<<<<<<<
}
__pyx_L76:;
- /* "lxml/html/clean.py":400
+ /* "lxml/html/clean.py":405
* el.clear()
*
* _kill.reverse() # start with innermost tags # <<<<<<<<<<<<<<
* for el in _kill:
* el.drop_tree()
*/
- __pyx_t_12 = PyList_Reverse(__pyx_v__kill); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 400, __pyx_L1_error)
+ __pyx_t_12 = PyList_Reverse(__pyx_v__kill); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 405, __pyx_L1_error)
- /* "lxml/html/clean.py":401
+ /* "lxml/html/clean.py":406
*
* _kill.reverse() # start with innermost tags
* for el in _kill: # <<<<<<<<<<<<<<
* el.drop_tree()
* for el in _remove:
*/
- __pyx_t_13 = __pyx_v__kill; __Pyx_INCREF(__pyx_t_13); __pyx_t_8 = 0;
+ __pyx_t_6 = __pyx_v__kill; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0;
for (;;) {
- if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_13)) break;
+ if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_5 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 401, __pyx_L1_error)
+ __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 406, __pyx_L1_error)
#else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_13, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 401, __pyx_L1_error)
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 406, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
#endif
__Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_5);
__pyx_t_5 = 0;
- /* "lxml/html/clean.py":402
+ /* "lxml/html/clean.py":407
* _kill.reverse() # start with innermost tags
* for el in _kill:
* el.drop_tree() # <<<<<<<<<<<<<<
* for el in _remove:
* el.drop_tag()
*/
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_drop_tree); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 402, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_drop_tree); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 407, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
__pyx_t_4 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_17);
if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_6, function);
+ __Pyx_DECREF_SET(__pyx_t_17, function);
}
}
- __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
+ __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_17);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 402, __pyx_L1_error)
+ if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 407, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":401
+ /* "lxml/html/clean.py":406
*
* _kill.reverse() # start with innermost tags
* for el in _kill: # <<<<<<<<<<<<<<
* for el in _remove:
*/
}
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "lxml/html/clean.py":403
+ /* "lxml/html/clean.py":408
* for el in _kill:
* el.drop_tree()
* for el in _remove: # <<<<<<<<<<<<<<
* el.drop_tag()
*
*/
- __pyx_t_13 = __pyx_v__remove; __Pyx_INCREF(__pyx_t_13); __pyx_t_8 = 0;
+ __pyx_t_6 = __pyx_v__remove; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0;
for (;;) {
- if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_13)) break;
+ if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_5 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 403, __pyx_L1_error)
+ __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 408, __pyx_L1_error)
#else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_13, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 403, __pyx_L1_error)
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 408, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
#endif
__Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_5);
__pyx_t_5 = 0;
- /* "lxml/html/clean.py":404
+ /* "lxml/html/clean.py":409
* el.drop_tree()
* for el in _remove:
* el.drop_tag() # <<<<<<<<<<<<<<
*
* if self.remove_unknown_tags:
*/
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_drop_tag); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 404, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_drop_tag); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 409, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
__pyx_t_4 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_17);
if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_6, function);
+ __Pyx_DECREF_SET(__pyx_t_17, function);
}
}
- __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
+ __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_17);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 404, __pyx_L1_error)
+ if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 409, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":403
+ /* "lxml/html/clean.py":408
* for el in _kill:
* el.drop_tree()
* for el in _remove: # <<<<<<<<<<<<<<
*
*/
}
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "lxml/html/clean.py":406
+ /* "lxml/html/clean.py":411
* el.drop_tag()
*
* if self.remove_unknown_tags: # <<<<<<<<<<<<<<
* if allow_tags:
* raise ValueError(
*/
- __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_remove_unknown_tags); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 406, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 406, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_remove_unknown_tags); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 411, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 411, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_10) {
- /* "lxml/html/clean.py":407
+ /* "lxml/html/clean.py":412
*
* if self.remove_unknown_tags:
* if allow_tags: # <<<<<<<<<<<<<<
__pyx_t_10 = (PySet_GET_SIZE(__pyx_v_allow_tags) != 0);
if (unlikely(__pyx_t_10)) {
- /* "lxml/html/clean.py":408
+ /* "lxml/html/clean.py":413
* if self.remove_unknown_tags:
* if allow_tags:
* raise ValueError( # <<<<<<<<<<<<<<
* "It does not make sense to pass in both allow_tags and remove_unknown_tags")
* allow_tags = set(defs.tags)
*/
- __pyx_t_13 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 408, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_Raise(__pyx_t_13, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __PYX_ERR(0, 408, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 413, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_Raise(__pyx_t_6, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __PYX_ERR(0, 413, __pyx_L1_error)
- /* "lxml/html/clean.py":407
+ /* "lxml/html/clean.py":412
*
* if self.remove_unknown_tags:
* if allow_tags: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":410
+ /* "lxml/html/clean.py":415
* raise ValueError(
* "It does not make sense to pass in both allow_tags and remove_unknown_tags")
* allow_tags = set(defs.tags) # <<<<<<<<<<<<<<
* if allow_tags:
* # make sure we do not remove comments/PIs if users want them (which is rare enough)
*/
- __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_defs); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 410, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_tags); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 410, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_defs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 415, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_tags); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 415, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_13 = PySet_New(__pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 410, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = PySet_New(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 415, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF_SET(__pyx_v_allow_tags, ((PyObject*)__pyx_t_13));
- __pyx_t_13 = 0;
+ __Pyx_DECREF_SET(__pyx_v_allow_tags, ((PyObject*)__pyx_t_6));
+ __pyx_t_6 = 0;
- /* "lxml/html/clean.py":406
+ /* "lxml/html/clean.py":411
* el.drop_tag()
*
* if self.remove_unknown_tags: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":411
+ /* "lxml/html/clean.py":416
* "It does not make sense to pass in both allow_tags and remove_unknown_tags")
* allow_tags = set(defs.tags)
* if allow_tags: # <<<<<<<<<<<<<<
__pyx_t_10 = (PySet_GET_SIZE(__pyx_v_allow_tags) != 0);
if (__pyx_t_10) {
- /* "lxml/html/clean.py":413
+ /* "lxml/html/clean.py":418
* if allow_tags:
* # make sure we do not remove comments/PIs if users want them (which is rare enough)
* if not self.comments: # <<<<<<<<<<<<<<
* allow_tags.add(etree.Comment)
* if not self.processing_instructions:
*/
- __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_comments); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 413, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 413, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_comments); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 418, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 418, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_11 = ((!__pyx_t_10) != 0);
if (__pyx_t_11) {
- /* "lxml/html/clean.py":414
+ /* "lxml/html/clean.py":419
* # make sure we do not remove comments/PIs if users want them (which is rare enough)
* if not self.comments:
* allow_tags.add(etree.Comment) # <<<<<<<<<<<<<<
* if not self.processing_instructions:
* allow_tags.add(etree.ProcessingInstruction)
*/
- __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_etree); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 414, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_Comment); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 414, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_etree); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 419, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_Comment); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 419, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_12 = PySet_Add(__pyx_v_allow_tags, __pyx_t_5); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 414, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_12 = PySet_Add(__pyx_v_allow_tags, __pyx_t_5); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 419, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":413
+ /* "lxml/html/clean.py":418
* if allow_tags:
* # make sure we do not remove comments/PIs if users want them (which is rare enough)
* if not self.comments: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":415
+ /* "lxml/html/clean.py":420
* if not self.comments:
* allow_tags.add(etree.Comment)
* if not self.processing_instructions: # <<<<<<<<<<<<<<
* allow_tags.add(etree.ProcessingInstruction)
*
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_processing_instructions); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 415, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_processing_instructions); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 420, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 415, __pyx_L1_error)
+ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 420, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_10 = ((!__pyx_t_11) != 0);
if (__pyx_t_10) {
- /* "lxml/html/clean.py":416
+ /* "lxml/html/clean.py":421
* allow_tags.add(etree.Comment)
* if not self.processing_instructions:
* allow_tags.add(etree.ProcessingInstruction) # <<<<<<<<<<<<<<
*
* bad = []
*/
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_etree); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 416, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_etree); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 421, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ProcessingInstruction); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 416, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ProcessingInstruction); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 421, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_12 = PySet_Add(__pyx_v_allow_tags, __pyx_t_13); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 416, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __pyx_t_12 = PySet_Add(__pyx_v_allow_tags, __pyx_t_6); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 421, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "lxml/html/clean.py":415
+ /* "lxml/html/clean.py":420
* if not self.comments:
* allow_tags.add(etree.Comment)
* if not self.processing_instructions: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":418
+ /* "lxml/html/clean.py":423
* allow_tags.add(etree.ProcessingInstruction)
*
* bad = [] # <<<<<<<<<<<<<<
* for el in doc.iter():
* if el.tag not in allow_tags:
*/
- __pyx_t_13 = PyList_New(0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 418, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_v_bad = ((PyObject*)__pyx_t_13);
- __pyx_t_13 = 0;
+ __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 423, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_v_bad = ((PyObject*)__pyx_t_6);
+ __pyx_t_6 = 0;
- /* "lxml/html/clean.py":419
+ /* "lxml/html/clean.py":424
*
* bad = []
* for el in doc.iter(): # <<<<<<<<<<<<<<
* if el.tag not in allow_tags:
* bad.append(el)
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_iter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 419, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_iter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 424, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = NULL;
+ __pyx_t_17 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_6)) {
+ __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_17)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_6);
+ __Pyx_INCREF(__pyx_t_17);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
- __pyx_t_13 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 419, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_6 = (__pyx_t_17) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_17) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
+ if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 424, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (likely(PyList_CheckExact(__pyx_t_13)) || PyTuple_CheckExact(__pyx_t_13)) {
- __pyx_t_5 = __pyx_t_13; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
+ if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
+ __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
__pyx_t_9 = NULL;
} else {
- __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 419, __pyx_L1_error)
+ __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 424, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 419, __pyx_L1_error)
+ __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 424, __pyx_L1_error)
}
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
for (;;) {
if (likely(!__pyx_t_9)) {
if (likely(PyList_CheckExact(__pyx_t_5))) {
if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_13 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_13); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 419, __pyx_L1_error)
+ __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 424, __pyx_L1_error)
#else
- __pyx_t_13 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 419, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 424, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
#endif
} else {
if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_13 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_13); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 419, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 424, __pyx_L1_error)
#else
- __pyx_t_13 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 419, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 424, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
#endif
}
} else {
- __pyx_t_13 = __pyx_t_9(__pyx_t_5);
- if (unlikely(!__pyx_t_13)) {
+ __pyx_t_6 = __pyx_t_9(__pyx_t_5);
+ if (unlikely(!__pyx_t_6)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 419, __pyx_L1_error)
+ else __PYX_ERR(0, 424, __pyx_L1_error)
}
break;
}
- __Pyx_GOTREF(__pyx_t_13);
+ __Pyx_GOTREF(__pyx_t_6);
}
- __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_13);
- __pyx_t_13 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_6);
+ __pyx_t_6 = 0;
- /* "lxml/html/clean.py":420
+ /* "lxml/html/clean.py":425
* bad = []
* for el in doc.iter():
* if el.tag not in allow_tags: # <<<<<<<<<<<<<<
* bad.append(el)
* if bad:
*/
- __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 420, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_10 = (__Pyx_PySet_ContainsTF(__pyx_t_13, __pyx_v_allow_tags, Py_NE)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 420, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 425, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_10 = (__Pyx_PySet_ContainsTF(__pyx_t_6, __pyx_v_allow_tags, Py_NE)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 425, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_11 = (__pyx_t_10 != 0);
if (__pyx_t_11) {
- /* "lxml/html/clean.py":421
+ /* "lxml/html/clean.py":426
* for el in doc.iter():
* if el.tag not in allow_tags:
* bad.append(el) # <<<<<<<<<<<<<<
* if bad:
* if bad[0] is doc:
*/
- __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_bad, __pyx_v_el); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 421, __pyx_L1_error)
+ __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_bad, __pyx_v_el); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 426, __pyx_L1_error)
- /* "lxml/html/clean.py":420
+ /* "lxml/html/clean.py":425
* bad = []
* for el in doc.iter():
* if el.tag not in allow_tags: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":419
+ /* "lxml/html/clean.py":424
*
* bad = []
* for el in doc.iter(): # <<<<<<<<<<<<<<
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":422
+ /* "lxml/html/clean.py":427
* if el.tag not in allow_tags:
* bad.append(el)
* if bad: # <<<<<<<<<<<<<<
__pyx_t_11 = (PyList_GET_SIZE(__pyx_v_bad) != 0);
if (__pyx_t_11) {
- /* "lxml/html/clean.py":423
+ /* "lxml/html/clean.py":428
* bad.append(el)
* if bad:
* if bad[0] is doc: # <<<<<<<<<<<<<<
* el = bad.pop(0)
* el.tag = 'div'
*/
- __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_bad, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 423, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_bad, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 428, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_11 = (__pyx_t_5 == __pyx_v_doc);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_10 = (__pyx_t_11 != 0);
if (__pyx_t_10) {
- /* "lxml/html/clean.py":424
+ /* "lxml/html/clean.py":429
* if bad:
* if bad[0] is doc:
* el = bad.pop(0) # <<<<<<<<<<<<<<
* el.tag = 'div'
* el.attrib.clear()
*/
- __pyx_t_5 = __Pyx_PyList_PopIndex(__pyx_v_bad, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 424, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyList_PopIndex(__pyx_v_bad, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 429, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_5);
__pyx_t_5 = 0;
- /* "lxml/html/clean.py":425
+ /* "lxml/html/clean.py":430
* if bad[0] is doc:
* el = bad.pop(0)
* el.tag = 'div' # <<<<<<<<<<<<<<
* el.attrib.clear()
* for el in bad:
*/
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_tag, __pyx_n_s_div) < 0) __PYX_ERR(0, 425, __pyx_L1_error)
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_tag, __pyx_n_s_div) < 0) __PYX_ERR(0, 430, __pyx_L1_error)
- /* "lxml/html/clean.py":426
+ /* "lxml/html/clean.py":431
* el = bad.pop(0)
* el.tag = 'div'
* el.attrib.clear() # <<<<<<<<<<<<<<
* for el in bad:
* el.drop_tag()
*/
- __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_attrib); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 426, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_clear); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 426, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_attrib); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 431, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_13 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
- if (likely(__pyx_t_13)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_13);
+ __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_clear); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 431, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_17);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
+ __Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_6, function);
+ __Pyx_DECREF_SET(__pyx_t_17, function);
}
}
- __pyx_t_5 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 426, __pyx_L1_error)
+ __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_17);
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 431, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":423
+ /* "lxml/html/clean.py":428
* bad.append(el)
* if bad:
* if bad[0] is doc: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":427
+ /* "lxml/html/clean.py":432
* el.tag = 'div'
* el.attrib.clear()
* for el in bad: # <<<<<<<<<<<<<<
for (;;) {
if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 427, __pyx_L1_error)
+ __pyx_t_17 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_17); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 432, __pyx_L1_error)
#else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 427, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_17 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 432, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
#endif
- __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_6);
- __pyx_t_6 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_17);
+ __pyx_t_17 = 0;
- /* "lxml/html/clean.py":428
+ /* "lxml/html/clean.py":433
* el.attrib.clear()
* for el in bad:
* el.drop_tag() # <<<<<<<<<<<<<<
* if self.add_nofollow:
* for el in _find_external_links(doc):
*/
- __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_drop_tag); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 428, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_drop_tag); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 433, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
__pyx_t_4 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13);
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_13, function);
+ __Pyx_DECREF_SET(__pyx_t_6, function);
}
}
- __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
+ __pyx_t_17 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 428, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 433, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
- /* "lxml/html/clean.py":427
+ /* "lxml/html/clean.py":432
* el.tag = 'div'
* el.attrib.clear()
* for el in bad: # <<<<<<<<<<<<<<
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":422
+ /* "lxml/html/clean.py":427
* if el.tag not in allow_tags:
* bad.append(el)
* if bad: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":411
+ /* "lxml/html/clean.py":416
* "It does not make sense to pass in both allow_tags and remove_unknown_tags")
* allow_tags = set(defs.tags)
* if allow_tags: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":429
+ /* "lxml/html/clean.py":434
* for el in bad:
* el.drop_tag()
* if self.add_nofollow: # <<<<<<<<<<<<<<
* for el in _find_external_links(doc):
* if not self.allow_follow(el):
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_add_nofollow); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 429, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_add_nofollow); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 429, __pyx_L1_error)
+ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 434, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_10) {
- /* "lxml/html/clean.py":430
+ /* "lxml/html/clean.py":435
* el.drop_tag()
* if self.add_nofollow:
* for el in _find_external_links(doc): # <<<<<<<<<<<<<<
* if not self.allow_follow(el):
* rel = el.get('rel')
*/
- __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_find_external_links); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 430, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_13 = NULL;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
- if (likely(__pyx_t_13)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_13);
+ __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_n_s_find_external_links); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 435, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_6 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_17);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
+ __Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_6, function);
+ __Pyx_DECREF_SET(__pyx_t_17, function);
}
}
- __pyx_t_5 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_13, __pyx_v_doc) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_doc);
- __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 430, __pyx_L1_error)
+ __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_17, __pyx_t_6, __pyx_v_doc) : __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_v_doc);
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 435, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
- __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0;
+ __pyx_t_17 = __pyx_t_5; __Pyx_INCREF(__pyx_t_17); __pyx_t_8 = 0;
__pyx_t_9 = NULL;
} else {
- __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 430, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 430, __pyx_L1_error)
+ __pyx_t_8 = -1; __pyx_t_17 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 435, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_9 = Py_TYPE(__pyx_t_17)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 435, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
for (;;) {
if (likely(!__pyx_t_9)) {
- if (likely(PyList_CheckExact(__pyx_t_6))) {
- if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break;
+ if (likely(PyList_CheckExact(__pyx_t_17))) {
+ if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_17)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 430, __pyx_L1_error)
+ __pyx_t_5 = PyList_GET_ITEM(__pyx_t_17, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 435, __pyx_L1_error)
#else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 430, __pyx_L1_error)
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_17, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 435, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
#endif
} else {
- if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
+ if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_17)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 430, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_17, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 435, __pyx_L1_error)
#else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 430, __pyx_L1_error)
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_17, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 435, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
#endif
}
} else {
- __pyx_t_5 = __pyx_t_9(__pyx_t_6);
+ __pyx_t_5 = __pyx_t_9(__pyx_t_17);
if (unlikely(!__pyx_t_5)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 430, __pyx_L1_error)
+ else __PYX_ERR(0, 435, __pyx_L1_error)
}
break;
}
__Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_5);
__pyx_t_5 = 0;
- /* "lxml/html/clean.py":431
+ /* "lxml/html/clean.py":436
* if self.add_nofollow:
* for el in _find_external_links(doc):
* if not self.allow_follow(el): # <<<<<<<<<<<<<<
* rel = el.get('rel')
* if rel:
*/
- __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_allow_follow); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 431, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_allow_follow); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 436, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
__pyx_t_4 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13);
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_13, function);
+ __Pyx_DECREF_SET(__pyx_t_6, function);
}
}
- __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_4, __pyx_v_el) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_v_el);
+ __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_v_el) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_el);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 431, __pyx_L1_error)
+ if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 436, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 431, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 436, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_11 = ((!__pyx_t_10) != 0);
if (__pyx_t_11) {
- /* "lxml/html/clean.py":432
+ /* "lxml/html/clean.py":437
* for el in _find_external_links(doc):
* if not self.allow_follow(el):
* rel = el.get('rel') # <<<<<<<<<<<<<<
* if rel:
* if ('nofollow' in rel
*/
- __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 432, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 437, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
__pyx_t_4 = NULL;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13);
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_13, function);
+ __Pyx_DECREF_SET(__pyx_t_6, function);
}
}
- __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_4, __pyx_n_s_rel) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_n_s_rel);
+ __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_n_s_rel) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_n_s_rel);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 432, __pyx_L1_error)
+ if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 437, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF_SET(__pyx_v_rel, __pyx_t_5);
__pyx_t_5 = 0;
- /* "lxml/html/clean.py":433
+ /* "lxml/html/clean.py":438
* if not self.allow_follow(el):
* rel = el.get('rel')
* if rel: # <<<<<<<<<<<<<<
* if ('nofollow' in rel
* and ' nofollow ' in (' %s ' % rel)):
*/
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_rel); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 433, __pyx_L1_error)
+ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_rel); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 438, __pyx_L1_error)
if (__pyx_t_11) {
- /* "lxml/html/clean.py":434
+ /* "lxml/html/clean.py":439
* rel = el.get('rel')
* if rel:
* if ('nofollow' in rel # <<<<<<<<<<<<<<
* and ' nofollow ' in (' %s ' % rel)):
* continue
*/
- __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_nofollow, __pyx_v_rel, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 434, __pyx_L1_error)
+ __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_nofollow, __pyx_v_rel, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 439, __pyx_L1_error)
__pyx_t_18 = (__pyx_t_10 != 0);
if (__pyx_t_18) {
} else {
goto __pyx_L104_bool_binop_done;
}
- /* "lxml/html/clean.py":435
+ /* "lxml/html/clean.py":440
* if rel:
* if ('nofollow' in rel
* and ' nofollow ' in (' %s ' % rel)): # <<<<<<<<<<<<<<
* continue
* rel = '%s nofollow' % rel
*/
- __pyx_t_5 = __Pyx_PyString_FormatSafe(__pyx_kp_s_s, __pyx_v_rel); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 435, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyString_FormatSafe(__pyx_kp_s_s, __pyx_v_rel); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 440, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_18 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s_nofollow_2, __pyx_t_5, Py_EQ)); if (unlikely(__pyx_t_18 < 0)) __PYX_ERR(0, 435, __pyx_L1_error)
+ __pyx_t_18 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s_nofollow_2, __pyx_t_5, Py_EQ)); if (unlikely(__pyx_t_18 < 0)) __PYX_ERR(0, 440, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_10 = (__pyx_t_18 != 0);
__pyx_t_11 = __pyx_t_10;
__pyx_L104_bool_binop_done:;
- /* "lxml/html/clean.py":434
+ /* "lxml/html/clean.py":439
* rel = el.get('rel')
* if rel:
* if ('nofollow' in rel # <<<<<<<<<<<<<<
*/
if (__pyx_t_11) {
- /* "lxml/html/clean.py":436
+ /* "lxml/html/clean.py":441
* if ('nofollow' in rel
* and ' nofollow ' in (' %s ' % rel)):
* continue # <<<<<<<<<<<<<<
*/
goto __pyx_L99_continue;
- /* "lxml/html/clean.py":434
+ /* "lxml/html/clean.py":439
* rel = el.get('rel')
* if rel:
* if ('nofollow' in rel # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":437
+ /* "lxml/html/clean.py":442
* and ' nofollow ' in (' %s ' % rel)):
* continue
* rel = '%s nofollow' % rel # <<<<<<<<<<<<<<
* else:
* rel = 'nofollow'
*/
- __pyx_t_5 = __Pyx_PyString_FormatSafe(__pyx_kp_s_s_nofollow, __pyx_v_rel); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 437, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyString_FormatSafe(__pyx_kp_s_s_nofollow, __pyx_v_rel); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 442, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF_SET(__pyx_v_rel, __pyx_t_5);
__pyx_t_5 = 0;
- /* "lxml/html/clean.py":433
+ /* "lxml/html/clean.py":438
* if not self.allow_follow(el):
* rel = el.get('rel')
* if rel: # <<<<<<<<<<<<<<
goto __pyx_L102;
}
- /* "lxml/html/clean.py":439
+ /* "lxml/html/clean.py":444
* rel = '%s nofollow' % rel
* else:
* rel = 'nofollow' # <<<<<<<<<<<<<<
}
__pyx_L102:;
- /* "lxml/html/clean.py":440
+ /* "lxml/html/clean.py":445
* else:
* rel = 'nofollow'
* el.set('rel', rel) # <<<<<<<<<<<<<<
*
* def allow_follow(self, anchor):
*/
- __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_set); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 440, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_set); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 445, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
__pyx_t_4 = NULL;
__pyx_t_7 = 0;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13);
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_13, function);
+ __Pyx_DECREF_SET(__pyx_t_6, function);
__pyx_t_7 = 1;
}
}
#if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_13)) {
+ if (PyFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_n_s_rel, __pyx_v_rel};
- __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 440, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 445, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
#if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) {
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_n_s_rel, __pyx_v_rel};
- __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 440, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 445, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
{
- __pyx_t_17 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 440, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_13 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 445, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_13);
if (__pyx_t_4) {
- __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_4); __pyx_t_4 = NULL;
}
__Pyx_INCREF(__pyx_n_s_rel);
__Pyx_GIVEREF(__pyx_n_s_rel);
- PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_7, __pyx_n_s_rel);
+ PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_7, __pyx_n_s_rel);
__Pyx_INCREF(__pyx_v_rel);
__Pyx_GIVEREF(__pyx_v_rel);
- PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_7, __pyx_v_rel);
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_17, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 440, __pyx_L1_error)
+ PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_7, __pyx_v_rel);
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_13, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 445, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
}
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":431
+ /* "lxml/html/clean.py":436
* if self.add_nofollow:
* for el in _find_external_links(doc):
* if not self.allow_follow(el): # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":430
+ /* "lxml/html/clean.py":435
* el.drop_tag()
* if self.add_nofollow:
* for el in _find_external_links(doc): # <<<<<<<<<<<<<<
*/
__pyx_L99_continue:;
}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
- /* "lxml/html/clean.py":429
+ /* "lxml/html/clean.py":434
* for el in bad:
* el.drop_tag()
* if self.add_nofollow: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":257
+ /* "lxml/html/clean.py":262
* )
*
* def __call__(self, doc): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "lxml/html/clean.py":442
+/* "lxml/html/clean.py":447
* el.set('rel', rel)
*
* def allow_follow(self, anchor): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_anchor)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("allow_follow", 1, 2, 2, 1); __PYX_ERR(0, 442, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("allow_follow", 1, 2, 2, 1); __PYX_ERR(0, 447, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "allow_follow") < 0)) __PYX_ERR(0, 442, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "allow_follow") < 0)) __PYX_ERR(0, 447, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("allow_follow", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 442, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("allow_follow", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 447, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("lxml.html.clean.Cleaner.allow_follow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("allow_follow", 0);
- /* "lxml/html/clean.py":446
+ /* "lxml/html/clean.py":451
* Override to suppress rel="nofollow" on some anchors.
* """
* return False # <<<<<<<<<<<<<<
__pyx_r = Py_False;
goto __pyx_L0;
- /* "lxml/html/clean.py":442
+ /* "lxml/html/clean.py":447
* el.set('rel', rel)
*
* def allow_follow(self, anchor): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "lxml/html/clean.py":448
+/* "lxml/html/clean.py":453
* return False
*
* def allow_element(self, el): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_el)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("allow_element", 1, 2, 2, 1); __PYX_ERR(0, 448, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("allow_element", 1, 2, 2, 1); __PYX_ERR(0, 453, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "allow_element") < 0)) __PYX_ERR(0, 448, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "allow_element") < 0)) __PYX_ERR(0, 453, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("allow_element", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 448, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("allow_element", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 453, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("lxml.html.clean.Cleaner.allow_element", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("allow_element", 0);
- /* "lxml/html/clean.py":455
+ /* "lxml/html/clean.py":460
* :return: true to accept the element or false to reject/discard it.
* """
* if el.tag not in self._tag_link_attrs: # <<<<<<<<<<<<<<
* return False
* attr = self._tag_link_attrs[el.tag]
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tag_link_attrs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tag_link_attrs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 460, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 455, __pyx_L1_error)
+ __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 460, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
- /* "lxml/html/clean.py":456
+ /* "lxml/html/clean.py":461
* """
* if el.tag not in self._tag_link_attrs:
* return False # <<<<<<<<<<<<<<
__pyx_r = Py_False;
goto __pyx_L0;
- /* "lxml/html/clean.py":455
+ /* "lxml/html/clean.py":460
* :return: true to accept the element or false to reject/discard it.
* """
* if el.tag not in self._tag_link_attrs: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":457
+ /* "lxml/html/clean.py":462
* if el.tag not in self._tag_link_attrs:
* return False
* attr = self._tag_link_attrs[el.tag] # <<<<<<<<<<<<<<
* if isinstance(attr, (list, tuple)):
* for one_attr in attr:
*/
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tag_link_attrs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tag_link_attrs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 457, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 462, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_attr = __pyx_t_5;
__pyx_t_5 = 0;
- /* "lxml/html/clean.py":458
+ /* "lxml/html/clean.py":463
* return False
* attr = self._tag_link_attrs[el.tag]
* if isinstance(attr, (list, tuple)): # <<<<<<<<<<<<<<
__pyx_t_3 = (__pyx_t_4 != 0);
if (__pyx_t_3) {
- /* "lxml/html/clean.py":459
+ /* "lxml/html/clean.py":464
* attr = self._tag_link_attrs[el.tag]
* if isinstance(attr, (list, tuple)):
* for one_attr in attr: # <<<<<<<<<<<<<<
__pyx_t_5 = __pyx_v_attr; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
} else {
- __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_attr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 459, __pyx_L1_error)
+ __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_attr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 464, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 459, __pyx_L1_error)
+ __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 464, __pyx_L1_error)
}
for (;;) {
if (likely(!__pyx_t_8)) {
if (likely(PyList_CheckExact(__pyx_t_5))) {
if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 459, __pyx_L1_error)
+ __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 464, __pyx_L1_error)
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L1_error)
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
} else {
if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 459, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 464, __pyx_L1_error)
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L1_error)
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
}
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 459, __pyx_L1_error)
+ else __PYX_ERR(0, 464, __pyx_L1_error)
}
break;
}
__Pyx_XDECREF_SET(__pyx_v_one_attr, __pyx_t_1);
__pyx_t_1 = 0;
- /* "lxml/html/clean.py":460
+ /* "lxml/html/clean.py":465
* if isinstance(attr, (list, tuple)):
* for one_attr in attr:
* url = el.get(one_attr) # <<<<<<<<<<<<<<
* if not url:
* return False
*/
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 460, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_9 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
}
__pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_9, __pyx_v_one_attr) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_one_attr);
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF_SET(__pyx_v_url, __pyx_t_1);
__pyx_t_1 = 0;
- /* "lxml/html/clean.py":461
+ /* "lxml/html/clean.py":466
* for one_attr in attr:
* url = el.get(one_attr)
* if not url: # <<<<<<<<<<<<<<
* return False
* if not self.allow_embedded_url(el, url):
*/
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_url); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 461, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_url); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 466, __pyx_L1_error)
__pyx_t_4 = ((!__pyx_t_3) != 0);
if (__pyx_t_4) {
- /* "lxml/html/clean.py":462
+ /* "lxml/html/clean.py":467
* url = el.get(one_attr)
* if not url:
* return False # <<<<<<<<<<<<<<
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
goto __pyx_L0;
- /* "lxml/html/clean.py":461
+ /* "lxml/html/clean.py":466
* for one_attr in attr:
* url = el.get(one_attr)
* if not url: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":463
+ /* "lxml/html/clean.py":468
* if not url:
* return False
* if not self.allow_embedded_url(el, url): # <<<<<<<<<<<<<<
* return False
* return True
*/
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_allow_embedded_url); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_allow_embedded_url); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 468, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_9 = NULL;
__pyx_t_10 = 0;
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_el, __pyx_v_url};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_el, __pyx_v_url};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else
#endif
{
- __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 463, __pyx_L1_error)
+ __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 468, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
if (__pyx_t_9) {
__Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
__Pyx_INCREF(__pyx_v_url);
__Pyx_GIVEREF(__pyx_v_url);
PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_v_url);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 463, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 468, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_3 = ((!__pyx_t_4) != 0);
if (__pyx_t_3) {
- /* "lxml/html/clean.py":464
+ /* "lxml/html/clean.py":469
* return False
* if not self.allow_embedded_url(el, url):
* return False # <<<<<<<<<<<<<<
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
goto __pyx_L0;
- /* "lxml/html/clean.py":463
+ /* "lxml/html/clean.py":468
* if not url:
* return False
* if not self.allow_embedded_url(el, url): # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":459
+ /* "lxml/html/clean.py":464
* attr = self._tag_link_attrs[el.tag]
* if isinstance(attr, (list, tuple)):
* for one_attr in attr: # <<<<<<<<<<<<<<
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":465
+ /* "lxml/html/clean.py":470
* if not self.allow_embedded_url(el, url):
* return False
* return True # <<<<<<<<<<<<<<
__pyx_r = Py_True;
goto __pyx_L0;
- /* "lxml/html/clean.py":458
+ /* "lxml/html/clean.py":463
* return False
* attr = self._tag_link_attrs[el.tag]
* if isinstance(attr, (list, tuple)): # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":467
+ /* "lxml/html/clean.py":472
* return True
* else:
* url = el.get(attr) # <<<<<<<<<<<<<<
* return False
*/
/*else*/ {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
}
__pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_v_attr) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_attr);
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 467, __pyx_L1_error)
+ if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_url = __pyx_t_5;
__pyx_t_5 = 0;
- /* "lxml/html/clean.py":468
+ /* "lxml/html/clean.py":473
* else:
* url = el.get(attr)
* if not url: # <<<<<<<<<<<<<<
* return False
* return self.allow_embedded_url(el, url)
*/
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_url); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 468, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_url); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 473, __pyx_L1_error)
__pyx_t_4 = ((!__pyx_t_3) != 0);
if (__pyx_t_4) {
- /* "lxml/html/clean.py":469
+ /* "lxml/html/clean.py":474
* url = el.get(attr)
* if not url:
* return False # <<<<<<<<<<<<<<
__pyx_r = Py_False;
goto __pyx_L0;
- /* "lxml/html/clean.py":468
+ /* "lxml/html/clean.py":473
* else:
* url = el.get(attr)
* if not url: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":470
+ /* "lxml/html/clean.py":475
* if not url:
* return False
* return self.allow_embedded_url(el, url) # <<<<<<<<<<<<<<
* def allow_embedded_url(self, el, url):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_allow_embedded_url); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_allow_embedded_url); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = NULL;
__pyx_t_10 = 0;
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_1)) {
PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_el, __pyx_v_url};
- __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 475, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_el, __pyx_v_url};
- __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 475, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
{
- __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 470, __pyx_L1_error)
+ __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 475, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
if (__pyx_t_2) {
__Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2); __pyx_t_2 = NULL;
__Pyx_INCREF(__pyx_v_url);
__Pyx_GIVEREF(__pyx_v_url);
PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_v_url);
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 475, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
}
goto __pyx_L0;
}
- /* "lxml/html/clean.py":448
+ /* "lxml/html/clean.py":453
* return False
*
* def allow_element(self, el): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "lxml/html/clean.py":472
+/* "lxml/html/clean.py":477
* return self.allow_embedded_url(el, url)
*
* def allow_embedded_url(self, el, url): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_el)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("allow_embedded_url", 1, 3, 3, 1); __PYX_ERR(0, 472, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("allow_embedded_url", 1, 3, 3, 1); __PYX_ERR(0, 477, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_url)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("allow_embedded_url", 1, 3, 3, 2); __PYX_ERR(0, 472, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("allow_embedded_url", 1, 3, 3, 2); __PYX_ERR(0, 477, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "allow_embedded_url") < 0)) __PYX_ERR(0, 472, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "allow_embedded_url") < 0)) __PYX_ERR(0, 477, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("allow_embedded_url", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 472, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("allow_embedded_url", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 477, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("lxml.html.clean.Cleaner.allow_embedded_url", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("allow_embedded_url", 0);
- /* "lxml/html/clean.py":481
+ /* "lxml/html/clean.py":486
* :return: true to accept the URL and false to reject it.
* """
* if self.whitelist_tags is not None and el.tag not in self.whitelist_tags: # <<<<<<<<<<<<<<
* return False
* scheme, netloc, path, query, fragment = urlsplit(url)
*/
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_whitelist_tags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_whitelist_tags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 486, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = (__pyx_t_2 != Py_None);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_1 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 486, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_whitelist_tags); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 481, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_whitelist_tags); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 486, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_5, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 481, __pyx_L1_error)
+ __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_5, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 486, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_3 = (__pyx_t_4 != 0);
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
- /* "lxml/html/clean.py":482
+ /* "lxml/html/clean.py":487
* """
* if self.whitelist_tags is not None and el.tag not in self.whitelist_tags:
* return False # <<<<<<<<<<<<<<
__pyx_r = Py_False;
goto __pyx_L0;
- /* "lxml/html/clean.py":481
+ /* "lxml/html/clean.py":486
* :return: true to accept the URL and false to reject it.
* """
* if self.whitelist_tags is not None and el.tag not in self.whitelist_tags: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":483
+ /* "lxml/html/clean.py":488
* if self.whitelist_tags is not None and el.tag not in self.whitelist_tags:
* return False
* scheme, netloc, path, query, fragment = urlsplit(url) # <<<<<<<<<<<<<<
* netloc = netloc.lower().split(':', 1)[0]
* if scheme not in ('http', 'https'):
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_urlsplit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_urlsplit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
}
__pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_v_url) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_url);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 483, __pyx_L1_error)
+ if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 488, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
if (unlikely(size != 5)) {
if (size > 5) __Pyx_RaiseTooManyValuesError(5);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- __PYX_ERR(0, 483, __pyx_L1_error)
+ __PYX_ERR(0, 488, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
Py_ssize_t i;
PyObject** temps[5] = {&__pyx_t_2,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9};
for (i=0; i < 5; i++) {
- PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 483, __pyx_L1_error)
+ PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 488, __pyx_L1_error)
__Pyx_GOTREF(item);
*(temps[i]) = item;
}
} else {
Py_ssize_t index = -1;
PyObject** temps[5] = {&__pyx_t_2,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9};
- __pyx_t_10 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 483, __pyx_L1_error)
+ __pyx_t_10 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 488, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
__Pyx_GOTREF(item);
*(temps[index]) = item;
}
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 5) < 0) __PYX_ERR(0, 483, __pyx_L1_error)
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 5) < 0) __PYX_ERR(0, 488, __pyx_L1_error)
__pyx_t_11 = NULL;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
goto __pyx_L7_unpacking_done;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_11 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 483, __pyx_L1_error)
+ __PYX_ERR(0, 488, __pyx_L1_error)
__pyx_L7_unpacking_done:;
}
__pyx_v_scheme = __pyx_t_2;
__pyx_v_fragment = __pyx_t_9;
__pyx_t_9 = 0;
- /* "lxml/html/clean.py":484
+ /* "lxml/html/clean.py":489
* return False
* scheme, netloc, path, query, fragment = urlsplit(url)
* netloc = netloc.lower().split(':', 1)[0] # <<<<<<<<<<<<<<
* if scheme not in ('http', 'https'):
* return False
*/
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_netloc, __pyx_n_s_lower); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 484, __pyx_L1_error)
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_netloc, __pyx_n_s_lower); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 489, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_8 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
}
__pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 484, __pyx_L1_error)
+ if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 489, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_split); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 484, __pyx_L1_error)
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_split); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 489, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 484, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 489, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 484, __pyx_L1_error)
+ __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 489, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF_SET(__pyx_v_netloc, __pyx_t_9);
__pyx_t_9 = 0;
- /* "lxml/html/clean.py":485
+ /* "lxml/html/clean.py":490
* scheme, netloc, path, query, fragment = urlsplit(url)
* netloc = netloc.lower().split(':', 1)[0]
* if scheme not in ('http', 'https'): # <<<<<<<<<<<<<<
*/
__Pyx_INCREF(__pyx_v_scheme);
__pyx_t_9 = __pyx_v_scheme;
- __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_http, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 485, __pyx_L1_error)
+ __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_http, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 490, __pyx_L1_error)
if (__pyx_t_3) {
} else {
__pyx_t_1 = __pyx_t_3;
goto __pyx_L9_bool_binop_done;
}
- __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_https, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 485, __pyx_L1_error)
+ __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_https, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 490, __pyx_L1_error)
__pyx_t_1 = __pyx_t_3;
__pyx_L9_bool_binop_done:;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_3 = (__pyx_t_1 != 0);
if (__pyx_t_3) {
- /* "lxml/html/clean.py":486
+ /* "lxml/html/clean.py":491
* netloc = netloc.lower().split(':', 1)[0]
* if scheme not in ('http', 'https'):
* return False # <<<<<<<<<<<<<<
__pyx_r = Py_False;
goto __pyx_L0;
- /* "lxml/html/clean.py":485
+ /* "lxml/html/clean.py":490
* scheme, netloc, path, query, fragment = urlsplit(url)
* netloc = netloc.lower().split(':', 1)[0]
* if scheme not in ('http', 'https'): # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":487
+ /* "lxml/html/clean.py":492
* if scheme not in ('http', 'https'):
* return False
* if netloc in self.host_whitelist: # <<<<<<<<<<<<<<
* return True
* return False
*/
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_host_whitelist); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 487, __pyx_L1_error)
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_host_whitelist); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 492, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_netloc, __pyx_t_9, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 487, __pyx_L1_error)
+ __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_netloc, __pyx_t_9, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 492, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_1 = (__pyx_t_3 != 0);
if (__pyx_t_1) {
- /* "lxml/html/clean.py":488
+ /* "lxml/html/clean.py":493
* return False
* if netloc in self.host_whitelist:
* return True # <<<<<<<<<<<<<<
__pyx_r = Py_True;
goto __pyx_L0;
- /* "lxml/html/clean.py":487
+ /* "lxml/html/clean.py":492
* if scheme not in ('http', 'https'):
* return False
* if netloc in self.host_whitelist: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":489
+ /* "lxml/html/clean.py":494
* if netloc in self.host_whitelist:
* return True
* return False # <<<<<<<<<<<<<<
__pyx_r = Py_False;
goto __pyx_L0;
- /* "lxml/html/clean.py":472
+ /* "lxml/html/clean.py":477
* return self.allow_embedded_url(el, url)
*
* def allow_embedded_url(self, el, url): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "lxml/html/clean.py":491
+/* "lxml/html/clean.py":496
* return False
*
* def kill_conditional_comments(self, doc): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_doc)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("kill_conditional_comments", 1, 2, 2, 1); __PYX_ERR(0, 491, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("kill_conditional_comments", 1, 2, 2, 1); __PYX_ERR(0, 496, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "kill_conditional_comments") < 0)) __PYX_ERR(0, 491, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "kill_conditional_comments") < 0)) __PYX_ERR(0, 496, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("kill_conditional_comments", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 491, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("kill_conditional_comments", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 496, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("lxml.html.clean.Cleaner.kill_conditional_comments", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "lxml/html/clean.py":499
+/* "lxml/html/clean.py":504
* has_conditional_comment = _conditional_comment_re.search
* self._kill_elements(
* doc, lambda el: has_conditional_comment(el.text), # <<<<<<<<<<<<<<
__pyx_outer_scope = (struct __pyx_obj_4lxml_4html_5clean___pyx_scope_struct__kill_conditional_comments *) __Pyx_CyFunction_GetClosure(__pyx_self);
__pyx_cur_scope = __pyx_outer_scope;
__Pyx_XDECREF(__pyx_r);
- if (unlikely(!__pyx_cur_scope->__pyx_v_has_conditional_comment)) { __Pyx_RaiseClosureNameError("has_conditional_comment"); __PYX_ERR(0, 499, __pyx_L1_error) }
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 499, __pyx_L1_error)
+ if (unlikely(!__pyx_cur_scope->__pyx_v_has_conditional_comment)) { __Pyx_RaiseClosureNameError("has_conditional_comment"); __PYX_ERR(0, 504, __pyx_L1_error) }
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 504, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_has_conditional_comment);
__pyx_t_3 = __pyx_cur_scope->__pyx_v_has_conditional_comment; __pyx_t_4 = NULL;
__pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 499, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_1;
return __pyx_r;
}
-/* "lxml/html/clean.py":491
+/* "lxml/html/clean.py":496
* return False
*
* def kill_conditional_comments(self, doc): # <<<<<<<<<<<<<<
if (unlikely(!__pyx_cur_scope)) {
__pyx_cur_scope = ((struct __pyx_obj_4lxml_4html_5clean___pyx_scope_struct__kill_conditional_comments *)Py_None);
__Pyx_INCREF(Py_None);
- __PYX_ERR(0, 491, __pyx_L1_error)
+ __PYX_ERR(0, 496, __pyx_L1_error)
} else {
__Pyx_GOTREF(__pyx_cur_scope);
}
- /* "lxml/html/clean.py":497
+ /* "lxml/html/clean.py":502
* we'll kill any comments that could be conditional.
* """
* has_conditional_comment = _conditional_comment_re.search # <<<<<<<<<<<<<<
* self._kill_elements(
* doc, lambda el: has_conditional_comment(el.text),
*/
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_conditional_comment_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 497, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_conditional_comment_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_search); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 497, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_search); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 502, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_GIVEREF(__pyx_t_2);
__pyx_cur_scope->__pyx_v_has_conditional_comment = __pyx_t_2;
__pyx_t_2 = 0;
- /* "lxml/html/clean.py":498
+ /* "lxml/html/clean.py":503
* """
* has_conditional_comment = _conditional_comment_re.search
* self._kill_elements( # <<<<<<<<<<<<<<
* doc, lambda el: has_conditional_comment(el.text),
* etree.Comment)
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_kill_elements); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 498, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_kill_elements); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- /* "lxml/html/clean.py":499
+ /* "lxml/html/clean.py":504
* has_conditional_comment = _conditional_comment_re.search
* self._kill_elements(
* doc, lambda el: has_conditional_comment(el.text), # <<<<<<<<<<<<<<
* etree.Comment)
*
*/
- __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_25kill_conditional_comments_lambda, 0, __pyx_n_s_Cleaner_kill_conditional_comment, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lxml_html_clean, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 499, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_25kill_conditional_comments_lambda, 0, __pyx_n_s_Cleaner_kill_conditional_comment, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lxml_html_clean, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 504, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- /* "lxml/html/clean.py":500
+ /* "lxml/html/clean.py":505
* self._kill_elements(
* doc, lambda el: has_conditional_comment(el.text),
* etree.Comment) # <<<<<<<<<<<<<<
*
* def _kill_elements(self, doc, condition, iterate=None):
*/
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_etree); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 500, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_etree); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 505, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Comment); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 500, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Comment); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_1)) {
PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_doc, __pyx_t_3, __pyx_t_5};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 498, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 503, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_doc, __pyx_t_3, __pyx_t_5};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 498, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 503, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
{
- __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 498, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 503, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (__pyx_t_4) {
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_t_5);
__pyx_t_3 = 0;
__pyx_t_5 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 498, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 503, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "lxml/html/clean.py":491
+ /* "lxml/html/clean.py":496
* return False
*
* def kill_conditional_comments(self, doc): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "lxml/html/clean.py":502
+/* "lxml/html/clean.py":507
* etree.Comment)
*
* def _kill_elements(self, doc, condition, iterate=None): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_doc)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_kill_elements", 0, 3, 4, 1); __PYX_ERR(0, 502, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("_kill_elements", 0, 3, 4, 1); __PYX_ERR(0, 507, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_condition)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_kill_elements", 0, 3, 4, 2); __PYX_ERR(0, 502, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("_kill_elements", 0, 3, 4, 2); __PYX_ERR(0, 507, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_kill_elements") < 0)) __PYX_ERR(0, 502, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_kill_elements") < 0)) __PYX_ERR(0, 507, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_kill_elements", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 502, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("_kill_elements", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 507, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("lxml.html.clean.Cleaner._kill_elements", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_kill_elements", 0);
- /* "lxml/html/clean.py":503
+ /* "lxml/html/clean.py":508
*
* def _kill_elements(self, doc, condition, iterate=None):
* bad = [] # <<<<<<<<<<<<<<
* for el in doc.iter(iterate):
* if condition(el):
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error)
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_bad = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "lxml/html/clean.py":504
+ /* "lxml/html/clean.py":509
* def _kill_elements(self, doc, condition, iterate=None):
* bad = []
* for el in doc.iter(iterate): # <<<<<<<<<<<<<<
* if condition(el):
* bad.append(el)
*/
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_iter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 504, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_iter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_iterate) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_iterate);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 509, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
__pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
__pyx_t_5 = NULL;
} else {
- __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 504, __pyx_L1_error)
+ __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 504, __pyx_L1_error)
+ __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 509, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
for (;;) {
if (likely(PyList_CheckExact(__pyx_t_2))) {
if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 504, __pyx_L1_error)
+ __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 509, __pyx_L1_error)
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error)
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 509, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
} else {
if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 504, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 509, __pyx_L1_error)
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error)
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 509, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
}
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 504, __pyx_L1_error)
+ else __PYX_ERR(0, 509, __pyx_L1_error)
}
break;
}
__Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_1);
__pyx_t_1 = 0;
- /* "lxml/html/clean.py":505
+ /* "lxml/html/clean.py":510
* bad = []
* for el in doc.iter(iterate):
* if condition(el): # <<<<<<<<<<<<<<
}
__pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_v_el) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_el);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 505, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 510, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_7) {
- /* "lxml/html/clean.py":506
+ /* "lxml/html/clean.py":511
* for el in doc.iter(iterate):
* if condition(el):
* bad.append(el) # <<<<<<<<<<<<<<
* for el in bad:
* el.drop_tree()
*/
- __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_bad, __pyx_v_el); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 506, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_bad, __pyx_v_el); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 511, __pyx_L1_error)
- /* "lxml/html/clean.py":505
+ /* "lxml/html/clean.py":510
* bad = []
* for el in doc.iter(iterate):
* if condition(el): # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":504
+ /* "lxml/html/clean.py":509
* def _kill_elements(self, doc, condition, iterate=None):
* bad = []
* for el in doc.iter(iterate): # <<<<<<<<<<<<<<
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "lxml/html/clean.py":507
+ /* "lxml/html/clean.py":512
* if condition(el):
* bad.append(el)
* for el in bad: # <<<<<<<<<<<<<<
for (;;) {
if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 507, __pyx_L1_error)
+ __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 512, __pyx_L1_error)
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 507, __pyx_L1_error)
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
__Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_1);
__pyx_t_1 = 0;
- /* "lxml/html/clean.py":508
+ /* "lxml/html/clean.py":513
* bad.append(el)
* for el in bad:
* el.drop_tree() # <<<<<<<<<<<<<<
*
* def _remove_javascript_link(self, link):
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_drop_tree); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_drop_tree); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 513, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "lxml/html/clean.py":507
+ /* "lxml/html/clean.py":512
* if condition(el):
* bad.append(el)
* for el in bad: # <<<<<<<<<<<<<<
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "lxml/html/clean.py":502
+ /* "lxml/html/clean.py":507
* etree.Comment)
*
* def _kill_elements(self, doc, condition, iterate=None): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "lxml/html/clean.py":510
+/* "lxml/html/clean.py":515
* el.drop_tree()
*
* def _remove_javascript_link(self, link): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_link)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_remove_javascript_link", 1, 2, 2, 1); __PYX_ERR(0, 510, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("_remove_javascript_link", 1, 2, 2, 1); __PYX_ERR(0, 515, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_remove_javascript_link") < 0)) __PYX_ERR(0, 510, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_remove_javascript_link") < 0)) __PYX_ERR(0, 515, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_remove_javascript_link", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 510, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("_remove_javascript_link", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 515, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("lxml.html.clean.Cleaner._remove_javascript_link", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_remove_javascript_link", 0);
- /* "lxml/html/clean.py":512
+ /* "lxml/html/clean.py":517
* def _remove_javascript_link(self, link):
* # links like "j a v a s c r i p t:" might be interpreted in IE
* new = _substitute_whitespace('', unquote_plus(link)) # <<<<<<<<<<<<<<
* if _is_javascript_scheme(new):
* # FIXME: should this be None to delete?
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_substitute_whitespace); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_substitute_whitespace); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 517, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_unquote_plus); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 512, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_unquote_plus); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 517, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
}
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_link) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_link);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 512, __pyx_L1_error)
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 517, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_kp_s__2, __pyx_t_3};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_kp_s__2, __pyx_t_3};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
{
- __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 512, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 517, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (__pyx_t_4) {
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__pyx_v_new = __pyx_t_1;
__pyx_t_1 = 0;
- /* "lxml/html/clean.py":513
+ /* "lxml/html/clean.py":518
* # links like "j a v a s c r i p t:" might be interpreted in IE
* new = _substitute_whitespace('', unquote_plus(link))
* if _is_javascript_scheme(new): # <<<<<<<<<<<<<<
* # FIXME: should this be None to delete?
* return ''
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_javascript_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 513, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_javascript_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 518, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
}
__pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_v_new) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_new);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 513, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 518, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_7) {
- /* "lxml/html/clean.py":515
+ /* "lxml/html/clean.py":520
* if _is_javascript_scheme(new):
* # FIXME: should this be None to delete?
* return '' # <<<<<<<<<<<<<<
__pyx_r = __pyx_kp_s__2;
goto __pyx_L0;
- /* "lxml/html/clean.py":513
+ /* "lxml/html/clean.py":518
* # links like "j a v a s c r i p t:" might be interpreted in IE
* new = _substitute_whitespace('', unquote_plus(link))
* if _is_javascript_scheme(new): # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":516
+ /* "lxml/html/clean.py":521
* # FIXME: should this be None to delete?
* return ''
* return link # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_link;
goto __pyx_L0;
- /* "lxml/html/clean.py":510
+ /* "lxml/html/clean.py":515
* el.drop_tree()
*
* def _remove_javascript_link(self, link): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "lxml/html/clean.py":520
+/* "lxml/html/clean.py":525
* _substitute_comments = re.compile(r'/\*.*?\*[inserted by cython to avoid comment closer]/', re.S).sub
*
* def _has_sneaky_javascript(self, style): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_style)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_has_sneaky_javascript", 1, 2, 2, 1); __PYX_ERR(0, 520, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("_has_sneaky_javascript", 1, 2, 2, 1); __PYX_ERR(0, 525, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_has_sneaky_javascript") < 0)) __PYX_ERR(0, 520, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_has_sneaky_javascript") < 0)) __PYX_ERR(0, 525, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_has_sneaky_javascript", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 520, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("_has_sneaky_javascript", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 525, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("lxml.html.clean.Cleaner._has_sneaky_javascript", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
__Pyx_RefNannySetupContext("_has_sneaky_javascript", 0);
__Pyx_INCREF(__pyx_v_style);
- /* "lxml/html/clean.py":531
+ /* "lxml/html/clean.py":536
* more sneaky attempts.
* """
* style = self._substitute_comments('', style) # <<<<<<<<<<<<<<
* style = style.replace('\\', '')
* style = _substitute_whitespace('', style)
*/
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_substitute_comments); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 531, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_substitute_comments); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
__pyx_t_4 = 0;
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_kp_s__2, __pyx_v_style};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 536, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_kp_s__2, __pyx_v_style};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 536, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else
#endif
{
- __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 531, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 536, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (__pyx_t_3) {
__Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
__Pyx_INCREF(__pyx_v_style);
__Pyx_GIVEREF(__pyx_v_style);
PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_style);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 536, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__Pyx_DECREF_SET(__pyx_v_style, __pyx_t_1);
__pyx_t_1 = 0;
- /* "lxml/html/clean.py":532
+ /* "lxml/html/clean.py":537
* """
* style = self._substitute_comments('', style)
* style = style.replace('\\', '') # <<<<<<<<<<<<<<
* style = _substitute_whitespace('', style)
* style = style.lower()
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_style, __pyx_n_s_replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 532, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_style, __pyx_n_s_replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 532, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF_SET(__pyx_v_style, __pyx_t_2);
__pyx_t_2 = 0;
- /* "lxml/html/clean.py":533
+ /* "lxml/html/clean.py":538
* style = self._substitute_comments('', style)
* style = style.replace('\\', '')
* style = _substitute_whitespace('', style) # <<<<<<<<<<<<<<
* style = style.lower()
* if 'javascript:' in style:
*/
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_substitute_whitespace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 533, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_substitute_whitespace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 538, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = NULL;
__pyx_t_4 = 0;
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_1)) {
PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_kp_s__2, __pyx_v_style};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 533, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_kp_s__2, __pyx_v_style};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 533, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
{
- __pyx_t_3 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 533, __pyx_L1_error)
+ __pyx_t_3 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 538, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (__pyx_t_5) {
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_INCREF(__pyx_v_style);
__Pyx_GIVEREF(__pyx_v_style);
PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_4, __pyx_v_style);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 533, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
__Pyx_DECREF_SET(__pyx_v_style, __pyx_t_2);
__pyx_t_2 = 0;
- /* "lxml/html/clean.py":534
+ /* "lxml/html/clean.py":539
* style = style.replace('\\', '')
* style = _substitute_whitespace('', style)
* style = style.lower() # <<<<<<<<<<<<<<
* if 'javascript:' in style:
* return True
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_style, __pyx_n_s_lower); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 534, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_style, __pyx_n_s_lower); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
}
__pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 534, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF_SET(__pyx_v_style, __pyx_t_2);
__pyx_t_2 = 0;
- /* "lxml/html/clean.py":535
+ /* "lxml/html/clean.py":540
* style = _substitute_whitespace('', style)
* style = style.lower()
* if 'javascript:' in style: # <<<<<<<<<<<<<<
* return True
* if 'expression(' in style:
*/
- __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s_javascript_2, __pyx_v_style, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 535, __pyx_L1_error)
+ __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s_javascript_2, __pyx_v_style, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 540, __pyx_L1_error)
__pyx_t_7 = (__pyx_t_6 != 0);
if (__pyx_t_7) {
- /* "lxml/html/clean.py":536
+ /* "lxml/html/clean.py":541
* style = style.lower()
* if 'javascript:' in style:
* return True # <<<<<<<<<<<<<<
__pyx_r = Py_True;
goto __pyx_L0;
- /* "lxml/html/clean.py":535
+ /* "lxml/html/clean.py":540
* style = _substitute_whitespace('', style)
* style = style.lower()
* if 'javascript:' in style: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":537
+ /* "lxml/html/clean.py":542
* if 'javascript:' in style:
* return True
* if 'expression(' in style: # <<<<<<<<<<<<<<
* return True
* if '</noscript' in style:
*/
- __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s_expression, __pyx_v_style, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 537, __pyx_L1_error)
+ __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s_expression, __pyx_v_style, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 542, __pyx_L1_error)
__pyx_t_6 = (__pyx_t_7 != 0);
if (__pyx_t_6) {
- /* "lxml/html/clean.py":538
+ /* "lxml/html/clean.py":543
* return True
* if 'expression(' in style:
* return True # <<<<<<<<<<<<<<
__pyx_r = Py_True;
goto __pyx_L0;
- /* "lxml/html/clean.py":537
+ /* "lxml/html/clean.py":542
* if 'javascript:' in style:
* return True
* if 'expression(' in style: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":539
+ /* "lxml/html/clean.py":544
* if 'expression(' in style:
* return True
* if '</noscript' in style: # <<<<<<<<<<<<<<
* # e.g. '<noscript><style><a title="</noscript><img src=x onerror=alert(1)>">'
* return True
*/
- __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s_noscript, __pyx_v_style, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 539, __pyx_L1_error)
+ __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s_noscript, __pyx_v_style, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 544, __pyx_L1_error)
__pyx_t_7 = (__pyx_t_6 != 0);
if (__pyx_t_7) {
- /* "lxml/html/clean.py":541
+ /* "lxml/html/clean.py":546
* if '</noscript' in style:
* # e.g. '<noscript><style><a title="</noscript><img src=x onerror=alert(1)>">'
* return True # <<<<<<<<<<<<<<
- * return False
- *
+ * if _looks_like_tag_content(style):
+ * # e.g. '<math><style><img src=x onerror=alert(1)></style></math>'
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(Py_True);
__pyx_r = Py_True;
goto __pyx_L0;
- /* "lxml/html/clean.py":539
+ /* "lxml/html/clean.py":544
* if 'expression(' in style:
* return True
* if '</noscript' in style: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":542
+ /* "lxml/html/clean.py":547
* # e.g. '<noscript><style><a title="</noscript><img src=x onerror=alert(1)>">'
* return True
- * return False # <<<<<<<<<<<<<<
- *
- * def clean_html(self, html):
+ * if _looks_like_tag_content(style): # <<<<<<<<<<<<<<
+ * # e.g. '<math><style><img src=x onerror=alert(1)></style></math>'
+ * return True
*/
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(Py_False);
- __pyx_r = Py_False;
- goto __pyx_L0;
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_looks_like_tag_content); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
+ __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
+ if (likely(__pyx_t_3)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_1, function);
+ }
+ }
+ __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_style) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_style);
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 547, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ if (__pyx_t_7) {
- /* "lxml/html/clean.py":520
- * _substitute_comments = re.compile(r'/\*.*?\*[inserted by cython to avoid comment closer]/', re.S).sub
+ /* "lxml/html/clean.py":549
+ * if _looks_like_tag_content(style):
+ * # e.g. '<math><style><img src=x onerror=alert(1)></style></math>'
+ * return True # <<<<<<<<<<<<<<
+ * return False
*
- * def _has_sneaky_javascript(self, style): # <<<<<<<<<<<<<<
- * """
- * Depending on the browser, stuff like ``e x p r e s s i o n(...)``
*/
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(Py_True);
+ __pyx_r = Py_True;
+ goto __pyx_L0;
- /* function exit code */
- __pyx_L1_error:;
+ /* "lxml/html/clean.py":547
+ * # e.g. '<noscript><style><a title="</noscript><img src=x onerror=alert(1)>">'
+ * return True
+ * if _looks_like_tag_content(style): # <<<<<<<<<<<<<<
+ * # e.g. '<math><style><img src=x onerror=alert(1)></style></math>'
+ * return True
+ */
+ }
+
+ /* "lxml/html/clean.py":550
+ * # e.g. '<math><style><img src=x onerror=alert(1)></style></math>'
+ * return True
+ * return False # <<<<<<<<<<<<<<
+ *
+ * def clean_html(self, html):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(Py_False);
+ __pyx_r = Py_False;
+ goto __pyx_L0;
+
+ /* "lxml/html/clean.py":525
+ * _substitute_comments = re.compile(r'/\*.*?\*[inserted by cython to avoid comment closer]/', re.S).sub
+ *
+ * def _has_sneaky_javascript(self, style): # <<<<<<<<<<<<<<
+ * """
+ * Depending on the browser, stuff like ``e x p r e s s i o n(...)``
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
return __pyx_r;
}
-/* "lxml/html/clean.py":544
+/* "lxml/html/clean.py":552
* return False
*
* def clean_html(self, html): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_html)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("clean_html", 1, 2, 2, 1); __PYX_ERR(0, 544, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("clean_html", 1, 2, 2, 1); __PYX_ERR(0, 552, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "clean_html") < 0)) __PYX_ERR(0, 544, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "clean_html") < 0)) __PYX_ERR(0, 552, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("clean_html", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 544, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("clean_html", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 552, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("lxml.html.clean.Cleaner.clean_html", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("clean_html", 0);
- /* "lxml/html/clean.py":545
+ /* "lxml/html/clean.py":553
*
* def clean_html(self, html):
* result_type = type(html) # <<<<<<<<<<<<<<
__Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_html)));
__pyx_v_result_type = ((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_v_html)));
- /* "lxml/html/clean.py":546
+ /* "lxml/html/clean.py":554
* def clean_html(self, html):
* result_type = type(html)
* if isinstance(html, basestring): # <<<<<<<<<<<<<<
* doc = fromstring(html)
* else:
*/
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_basestring); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_basestring); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_IsInstance(__pyx_v_html, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 546, __pyx_L1_error)
+ __pyx_t_2 = PyObject_IsInstance(__pyx_v_html, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 554, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
- /* "lxml/html/clean.py":547
+ /* "lxml/html/clean.py":555
* result_type = type(html)
* if isinstance(html, basestring):
* doc = fromstring(html) # <<<<<<<<<<<<<<
* else:
* doc = copy.deepcopy(html)
*/
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_fromstring); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 547, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_fromstring); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 555, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
}
__pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_html) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_html);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 555, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_doc = __pyx_t_1;
__pyx_t_1 = 0;
- /* "lxml/html/clean.py":546
+ /* "lxml/html/clean.py":554
* def clean_html(self, html):
* result_type = type(html)
* if isinstance(html, basestring): # <<<<<<<<<<<<<<
goto __pyx_L3;
}
- /* "lxml/html/clean.py":549
+ /* "lxml/html/clean.py":557
* doc = fromstring(html)
* else:
* doc = copy.deepcopy(html) # <<<<<<<<<<<<<<
* return _transform_result(result_type, doc)
*/
/*else*/ {
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 549, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 557, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_deepcopy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 549, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_deepcopy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 557, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
}
__pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_html) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_html);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_doc = __pyx_t_1;
}
__pyx_L3:;
- /* "lxml/html/clean.py":550
+ /* "lxml/html/clean.py":558
* else:
* doc = copy.deepcopy(html)
* self(doc) # <<<<<<<<<<<<<<
}
__pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_doc) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_doc);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "lxml/html/clean.py":551
+ /* "lxml/html/clean.py":559
* doc = copy.deepcopy(html)
* self(doc)
* return _transform_result(result_type, doc) # <<<<<<<<<<<<<<
* clean = Cleaner()
*/
__Pyx_XDECREF(__pyx_r);
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_transform_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 551, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_transform_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 559, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = NULL;
__pyx_t_6 = 0;
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_result_type), __pyx_v_doc};
- __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_result_type), __pyx_v_doc};
- __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else
#endif
{
- __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 551, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 559, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (__pyx_t_4) {
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
__Pyx_INCREF(__pyx_v_doc);
__Pyx_GIVEREF(__pyx_v_doc);
PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_doc);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "lxml/html/clean.py":544
+ /* "lxml/html/clean.py":552
* return False
*
* def clean_html(self, html): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "lxml/html/clean.py":576
+/* "lxml/html/clean.py":584
* _avoid_classes = ['nolink']
*
* def autolink(el, link_regexes=_link_regexes, # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__defaults__", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_link_regexes);
__Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_link_regexes);
__Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_avoid_classes);
__Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_avoid_classes);
PyTuple_SET_ITEM(__pyx_t_1, 3, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_avoid_classes);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 576, __pyx_L1_error)
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 584, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "autolink") < 0)) __PYX_ERR(0, 576, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "autolink") < 0)) __PYX_ERR(0, 584, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("autolink", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 576, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("autolink", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 584, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("lxml.html.clean.autolink", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("autolink", 0);
- /* "lxml/html/clean.py":594
+ /* "lxml/html/clean.py":602
* substituted, only the contents of the element.
* """
* if el.tag in avoid_elements: # <<<<<<<<<<<<<<
* return
* class_name = el.get('class')
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 594, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_avoid_elements, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 594, __pyx_L1_error)
+ __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_avoid_elements, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 602, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
- /* "lxml/html/clean.py":595
+ /* "lxml/html/clean.py":603
* """
* if el.tag in avoid_elements:
* return # <<<<<<<<<<<<<<
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
- /* "lxml/html/clean.py":594
+ /* "lxml/html/clean.py":602
* substituted, only the contents of the element.
* """
* if el.tag in avoid_elements: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":596
+ /* "lxml/html/clean.py":604
* if el.tag in avoid_elements:
* return
* class_name = el.get('class') # <<<<<<<<<<<<<<
* if class_name:
* class_name = class_name.split()
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 596, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 604, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
}
__pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_n_s_class) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_s_class);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 596, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_class_name = __pyx_t_1;
__pyx_t_1 = 0;
- /* "lxml/html/clean.py":597
+ /* "lxml/html/clean.py":605
* return
* class_name = el.get('class')
* if class_name: # <<<<<<<<<<<<<<
* class_name = class_name.split()
* for match_class in avoid_classes:
*/
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_class_name); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 597, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_class_name); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 605, __pyx_L1_error)
if (__pyx_t_3) {
- /* "lxml/html/clean.py":598
+ /* "lxml/html/clean.py":606
* class_name = el.get('class')
* if class_name:
* class_name = class_name.split() # <<<<<<<<<<<<<<
* for match_class in avoid_classes:
* if match_class in class_name:
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_class_name, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 598, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_class_name, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 606, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
}
__pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 598, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 606, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF_SET(__pyx_v_class_name, __pyx_t_1);
__pyx_t_1 = 0;
- /* "lxml/html/clean.py":599
+ /* "lxml/html/clean.py":607
* if class_name:
* class_name = class_name.split()
* for match_class in avoid_classes: # <<<<<<<<<<<<<<
__pyx_t_1 = __pyx_v_avoid_classes; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
__pyx_t_7 = NULL;
} else {
- __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_avoid_classes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 599, __pyx_L1_error)
+ __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_avoid_classes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 607, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 599, __pyx_L1_error)
+ __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 607, __pyx_L1_error)
}
for (;;) {
if (likely(!__pyx_t_7)) {
if (likely(PyList_CheckExact(__pyx_t_1))) {
if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 599, __pyx_L1_error)
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 607, __pyx_L1_error)
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 599, __pyx_L1_error)
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 607, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
#endif
} else {
if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 599, __pyx_L1_error)
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 607, __pyx_L1_error)
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 599, __pyx_L1_error)
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 607, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
#endif
}
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 599, __pyx_L1_error)
+ else __PYX_ERR(0, 607, __pyx_L1_error)
}
break;
}
__Pyx_XDECREF_SET(__pyx_v_match_class, __pyx_t_4);
__pyx_t_4 = 0;
- /* "lxml/html/clean.py":600
+ /* "lxml/html/clean.py":608
* class_name = class_name.split()
* for match_class in avoid_classes:
* if match_class in class_name: # <<<<<<<<<<<<<<
* return
* for child in list(el):
*/
- __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_match_class, __pyx_v_class_name, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 600, __pyx_L1_error)
+ __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_match_class, __pyx_v_class_name, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 608, __pyx_L1_error)
__pyx_t_2 = (__pyx_t_3 != 0);
if (__pyx_t_2) {
- /* "lxml/html/clean.py":601
+ /* "lxml/html/clean.py":609
* for match_class in avoid_classes:
* if match_class in class_name:
* return # <<<<<<<<<<<<<<
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
- /* "lxml/html/clean.py":600
+ /* "lxml/html/clean.py":608
* class_name = class_name.split()
* for match_class in avoid_classes:
* if match_class in class_name: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":599
+ /* "lxml/html/clean.py":607
* if class_name:
* class_name = class_name.split()
* for match_class in avoid_classes: # <<<<<<<<<<<<<<
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "lxml/html/clean.py":597
+ /* "lxml/html/clean.py":605
* return
* class_name = el.get('class')
* if class_name: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":602
+ /* "lxml/html/clean.py":610
* if match_class in class_name:
* return
* for child in list(el): # <<<<<<<<<<<<<<
* autolink(child, link_regexes=link_regexes,
* avoid_elements=avoid_elements,
*/
- __pyx_t_1 = PySequence_List(__pyx_v_el); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error)
+ __pyx_t_1 = PySequence_List(__pyx_v_el); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 610, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
for (;;) {
if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 602, __pyx_L1_error)
+ __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 610, __pyx_L1_error)
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error)
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 610, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
__Pyx_XDECREF_SET(__pyx_v_child, __pyx_t_1);
__pyx_t_1 = 0;
- /* "lxml/html/clean.py":603
+ /* "lxml/html/clean.py":611
* return
* for child in list(el):
* autolink(child, link_regexes=link_regexes, # <<<<<<<<<<<<<<
* avoid_elements=avoid_elements,
* avoid_hosts=avoid_hosts,
*/
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_autolink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 603, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_autolink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 603, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 611, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(__pyx_v_child);
__Pyx_GIVEREF(__pyx_v_child);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_child);
- __pyx_t_8 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 603, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 611, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_link_regexes, __pyx_v_link_regexes) < 0) __PYX_ERR(0, 603, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_link_regexes, __pyx_v_link_regexes) < 0) __PYX_ERR(0, 611, __pyx_L1_error)
- /* "lxml/html/clean.py":604
+ /* "lxml/html/clean.py":612
* for child in list(el):
* autolink(child, link_regexes=link_regexes,
* avoid_elements=avoid_elements, # <<<<<<<<<<<<<<
* avoid_hosts=avoid_hosts,
* avoid_classes=avoid_classes)
*/
- if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_avoid_elements, __pyx_v_avoid_elements) < 0) __PYX_ERR(0, 603, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_avoid_elements, __pyx_v_avoid_elements) < 0) __PYX_ERR(0, 611, __pyx_L1_error)
- /* "lxml/html/clean.py":605
+ /* "lxml/html/clean.py":613
* autolink(child, link_regexes=link_regexes,
* avoid_elements=avoid_elements,
* avoid_hosts=avoid_hosts, # <<<<<<<<<<<<<<
* avoid_classes=avoid_classes)
* if child.tail:
*/
- if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_avoid_hosts, __pyx_v_avoid_hosts) < 0) __PYX_ERR(0, 603, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_avoid_hosts, __pyx_v_avoid_hosts) < 0) __PYX_ERR(0, 611, __pyx_L1_error)
- /* "lxml/html/clean.py":606
+ /* "lxml/html/clean.py":614
* avoid_elements=avoid_elements,
* avoid_hosts=avoid_hosts,
* avoid_classes=avoid_classes) # <<<<<<<<<<<<<<
* if child.tail:
* text, tail_children = _link_text(
*/
- if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_avoid_classes, __pyx_v_avoid_classes) < 0) __PYX_ERR(0, 603, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_avoid_classes, __pyx_v_avoid_classes) < 0) __PYX_ERR(0, 611, __pyx_L1_error)
- /* "lxml/html/clean.py":603
+ /* "lxml/html/clean.py":611
* return
* for child in list(el):
* autolink(child, link_regexes=link_regexes, # <<<<<<<<<<<<<<
* avoid_elements=avoid_elements,
* avoid_hosts=avoid_hosts,
*/
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 603, __pyx_L1_error)
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 611, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- /* "lxml/html/clean.py":607
+ /* "lxml/html/clean.py":615
* avoid_hosts=avoid_hosts,
* avoid_classes=avoid_classes)
* if child.tail: # <<<<<<<<<<<<<<
* text, tail_children = _link_text(
* child.tail, link_regexes, avoid_hosts, factory=el.makeelement)
*/
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_tail); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 607, __pyx_L1_error)
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_tail); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 615, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 607, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 615, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
if (__pyx_t_2) {
- /* "lxml/html/clean.py":608
+ /* "lxml/html/clean.py":616
* avoid_classes=avoid_classes)
* if child.tail:
* text, tail_children = _link_text( # <<<<<<<<<<<<<<
* child.tail, link_regexes, avoid_hosts, factory=el.makeelement)
* if tail_children:
*/
- __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_link_text); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 608, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_link_text); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 616, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- /* "lxml/html/clean.py":609
+ /* "lxml/html/clean.py":617
* if child.tail:
* text, tail_children = _link_text(
* child.tail, link_regexes, avoid_hosts, factory=el.makeelement) # <<<<<<<<<<<<<<
* if tail_children:
* child.tail = text
*/
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_tail); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 609, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_tail); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 617, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- /* "lxml/html/clean.py":608
+ /* "lxml/html/clean.py":616
* avoid_classes=avoid_classes)
* if child.tail:
* text, tail_children = _link_text( # <<<<<<<<<<<<<<
* child.tail, link_regexes, avoid_hosts, factory=el.makeelement)
* if tail_children:
*/
- __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 608, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 616, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_avoid_hosts);
__pyx_t_8 = 0;
- /* "lxml/html/clean.py":609
+ /* "lxml/html/clean.py":617
* if child.tail:
* text, tail_children = _link_text(
* child.tail, link_regexes, avoid_hosts, factory=el.makeelement) # <<<<<<<<<<<<<<
* if tail_children:
* child.tail = text
*/
- __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 609, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 617, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_makeelement); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 609, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_makeelement); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 617, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_factory, __pyx_t_1) < 0) __PYX_ERR(0, 609, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_factory, __pyx_t_1) < 0) __PYX_ERR(0, 617, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "lxml/html/clean.py":608
+ /* "lxml/html/clean.py":616
* avoid_classes=avoid_classes)
* if child.tail:
* text, tail_children = _link_text( # <<<<<<<<<<<<<<
* child.tail, link_regexes, avoid_hosts, factory=el.makeelement)
* if tail_children:
*/
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 608, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- __PYX_ERR(0, 608, __pyx_L1_error)
+ __PYX_ERR(0, 616, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(__pyx_t_5);
#else
- __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 608, __pyx_L1_error)
+ __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 616, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 608, __pyx_L1_error)
+ __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 616, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
#endif
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
} else {
Py_ssize_t index = -1;
- __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 608, __pyx_L1_error)
+ __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 616, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
__Pyx_GOTREF(__pyx_t_8);
index = 1; __pyx_t_5 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_5)) goto __pyx_L11_unpacking_failed;
__Pyx_GOTREF(__pyx_t_5);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 608, __pyx_L1_error)
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 616, __pyx_L1_error)
__pyx_t_10 = NULL;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L12_unpacking_done;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_10 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 608, __pyx_L1_error)
+ __PYX_ERR(0, 616, __pyx_L1_error)
__pyx_L12_unpacking_done:;
}
__Pyx_XDECREF_SET(__pyx_v_text, __pyx_t_8);
__Pyx_XDECREF_SET(__pyx_v_tail_children, __pyx_t_5);
__pyx_t_5 = 0;
- /* "lxml/html/clean.py":610
+ /* "lxml/html/clean.py":618
* text, tail_children = _link_text(
* child.tail, link_regexes, avoid_hosts, factory=el.makeelement)
* if tail_children: # <<<<<<<<<<<<<<
* child.tail = text
* index = el.index(child)
*/
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_tail_children); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 610, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_tail_children); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 618, __pyx_L1_error)
if (__pyx_t_2) {
- /* "lxml/html/clean.py":611
+ /* "lxml/html/clean.py":619
* child.tail, link_regexes, avoid_hosts, factory=el.makeelement)
* if tail_children:
* child.tail = text # <<<<<<<<<<<<<<
* index = el.index(child)
* el[index+1:index+1] = tail_children
*/
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_child, __pyx_n_s_tail, __pyx_v_text) < 0) __PYX_ERR(0, 611, __pyx_L1_error)
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_child, __pyx_n_s_tail, __pyx_v_text) < 0) __PYX_ERR(0, 619, __pyx_L1_error)
- /* "lxml/html/clean.py":612
+ /* "lxml/html/clean.py":620
* if tail_children:
* child.tail = text
* index = el.index(child) # <<<<<<<<<<<<<<
* el[index+1:index+1] = tail_children
* if el.text:
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 612, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 620, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_8 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
}
__pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_v_child) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_child);
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 612, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 620, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_1);
__pyx_t_1 = 0;
- /* "lxml/html/clean.py":613
+ /* "lxml/html/clean.py":621
* child.tail = text
* index = el.index(child)
* el[index+1:index+1] = tail_children # <<<<<<<<<<<<<<
* if el.text:
* text, pre_children = _link_text(
*/
- __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_index, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 613, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_index, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 621, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_index, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 613, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_index, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 621, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- if (__Pyx_PyObject_SetSlice(__pyx_v_el, __pyx_v_tail_children, 0, 0, &__pyx_t_1, &__pyx_t_5, NULL, 0, 0, 1) < 0) __PYX_ERR(0, 613, __pyx_L1_error)
+ if (__Pyx_PyObject_SetSlice(__pyx_v_el, __pyx_v_tail_children, 0, 0, &__pyx_t_1, &__pyx_t_5, NULL, 0, 0, 1) < 0) __PYX_ERR(0, 621, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":610
+ /* "lxml/html/clean.py":618
* text, tail_children = _link_text(
* child.tail, link_regexes, avoid_hosts, factory=el.makeelement)
* if tail_children: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":607
+ /* "lxml/html/clean.py":615
* avoid_hosts=avoid_hosts,
* avoid_classes=avoid_classes)
* if child.tail: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":602
+ /* "lxml/html/clean.py":610
* if match_class in class_name:
* return
* for child in list(el): # <<<<<<<<<<<<<<
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "lxml/html/clean.py":614
+ /* "lxml/html/clean.py":622
* index = el.index(child)
* el[index+1:index+1] = tail_children
* if el.text: # <<<<<<<<<<<<<<
* text, pre_children = _link_text(
* el.text, link_regexes, avoid_hosts, factory=el.makeelement)
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_text); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 614, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_text); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 622, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 614, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 622, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_2) {
- /* "lxml/html/clean.py":615
+ /* "lxml/html/clean.py":623
* el[index+1:index+1] = tail_children
* if el.text:
* text, pre_children = _link_text( # <<<<<<<<<<<<<<
* el.text, link_regexes, avoid_hosts, factory=el.makeelement)
* if pre_children:
*/
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_link_text); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 615, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_link_text); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- /* "lxml/html/clean.py":616
+ /* "lxml/html/clean.py":624
* if el.text:
* text, pre_children = _link_text(
* el.text, link_regexes, avoid_hosts, factory=el.makeelement) # <<<<<<<<<<<<<<
* if pre_children:
* el.text = text
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_text); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 616, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_text); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 624, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- /* "lxml/html/clean.py":615
+ /* "lxml/html/clean.py":623
* el[index+1:index+1] = tail_children
* if el.text:
* text, pre_children = _link_text( # <<<<<<<<<<<<<<
* el.text, link_regexes, avoid_hosts, factory=el.makeelement)
* if pre_children:
*/
- __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 615, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_avoid_hosts);
__pyx_t_5 = 0;
- /* "lxml/html/clean.py":616
+ /* "lxml/html/clean.py":624
* if el.text:
* text, pre_children = _link_text(
* el.text, link_regexes, avoid_hosts, factory=el.makeelement) # <<<<<<<<<<<<<<
* if pre_children:
* el.text = text
*/
- __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 616, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 624, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_makeelement); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 616, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_makeelement); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 624, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_factory, __pyx_t_8) < 0) __PYX_ERR(0, 616, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_factory, __pyx_t_8) < 0) __PYX_ERR(0, 624, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- /* "lxml/html/clean.py":615
+ /* "lxml/html/clean.py":623
* el[index+1:index+1] = tail_children
* if el.text:
* text, pre_children = _link_text( # <<<<<<<<<<<<<<
* el.text, link_regexes, avoid_hosts, factory=el.makeelement)
* if pre_children:
*/
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 615, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 623, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- __PYX_ERR(0, 615, __pyx_L1_error)
+ __PYX_ERR(0, 623, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_1);
#else
- __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 615, __pyx_L1_error)
+ __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 623, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 615, __pyx_L1_error)
+ __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
} else {
Py_ssize_t index = -1;
- __pyx_t_4 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 615, __pyx_L1_error)
+ __pyx_t_4 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_10 = Py_TYPE(__pyx_t_4)->tp_iternext;
__Pyx_GOTREF(__pyx_t_5);
index = 1; __pyx_t_1 = __pyx_t_10(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L15_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_4), 2) < 0) __PYX_ERR(0, 615, __pyx_L1_error)
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_4), 2) < 0) __PYX_ERR(0, 623, __pyx_L1_error)
__pyx_t_10 = NULL;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
goto __pyx_L16_unpacking_done;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_10 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 615, __pyx_L1_error)
+ __PYX_ERR(0, 623, __pyx_L1_error)
__pyx_L16_unpacking_done:;
}
__Pyx_XDECREF_SET(__pyx_v_text, __pyx_t_5);
__pyx_v_pre_children = __pyx_t_1;
__pyx_t_1 = 0;
- /* "lxml/html/clean.py":617
+ /* "lxml/html/clean.py":625
* text, pre_children = _link_text(
* el.text, link_regexes, avoid_hosts, factory=el.makeelement)
* if pre_children: # <<<<<<<<<<<<<<
* el.text = text
* el[:0] = pre_children
*/
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_pre_children); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 617, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_pre_children); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 625, __pyx_L1_error)
if (__pyx_t_2) {
- /* "lxml/html/clean.py":618
+ /* "lxml/html/clean.py":626
* el.text, link_regexes, avoid_hosts, factory=el.makeelement)
* if pre_children:
* el.text = text # <<<<<<<<<<<<<<
* el[:0] = pre_children
*
*/
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_text, __pyx_v_text) < 0) __PYX_ERR(0, 618, __pyx_L1_error)
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_text, __pyx_v_text) < 0) __PYX_ERR(0, 626, __pyx_L1_error)
- /* "lxml/html/clean.py":619
+ /* "lxml/html/clean.py":627
* if pre_children:
* el.text = text
* el[:0] = pre_children # <<<<<<<<<<<<<<
*
* def _link_text(text, link_regexes, avoid_hosts, factory):
*/
- if (__Pyx_PyObject_SetSlice(__pyx_v_el, __pyx_v_pre_children, 0, 0, NULL, NULL, &__pyx_slice__14, 0, 1, 1) < 0) __PYX_ERR(0, 619, __pyx_L1_error)
+ if (__Pyx_PyObject_SetSlice(__pyx_v_el, __pyx_v_pre_children, 0, 0, NULL, NULL, &__pyx_slice__14, 0, 1, 1) < 0) __PYX_ERR(0, 627, __pyx_L1_error)
- /* "lxml/html/clean.py":617
+ /* "lxml/html/clean.py":625
* text, pre_children = _link_text(
* el.text, link_regexes, avoid_hosts, factory=el.makeelement)
* if pre_children: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":614
+ /* "lxml/html/clean.py":622
* index = el.index(child)
* el[index+1:index+1] = tail_children
* if el.text: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":576
+ /* "lxml/html/clean.py":584
* _avoid_classes = ['nolink']
*
* def autolink(el, link_regexes=_link_regexes, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "lxml/html/clean.py":621
+/* "lxml/html/clean.py":629
* el[:0] = pre_children
*
* def _link_text(text, link_regexes, avoid_hosts, factory): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_link_regexes)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_link_text", 1, 4, 4, 1); __PYX_ERR(0, 621, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("_link_text", 1, 4, 4, 1); __PYX_ERR(0, 629, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_avoid_hosts)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_link_text", 1, 4, 4, 2); __PYX_ERR(0, 621, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("_link_text", 1, 4, 4, 2); __PYX_ERR(0, 629, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_factory)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_link_text", 1, 4, 4, 3); __PYX_ERR(0, 621, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("_link_text", 1, 4, 4, 3); __PYX_ERR(0, 629, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_link_text") < 0)) __PYX_ERR(0, 621, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_link_text") < 0)) __PYX_ERR(0, 629, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
goto __pyx_L5_argtuple_error;
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_link_text", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 621, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("_link_text", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 629, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("lxml.html.clean._link_text", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
__Pyx_RefNannySetupContext("_link_text", 0);
__Pyx_INCREF(__pyx_v_text);
- /* "lxml/html/clean.py":622
+ /* "lxml/html/clean.py":630
*
* def _link_text(text, link_regexes, avoid_hosts, factory):
* leading_text = '' # <<<<<<<<<<<<<<
__Pyx_INCREF(__pyx_kp_s__2);
__pyx_v_leading_text = __pyx_kp_s__2;
- /* "lxml/html/clean.py":623
+ /* "lxml/html/clean.py":631
* def _link_text(text, link_regexes, avoid_hosts, factory):
* leading_text = ''
* links = [] # <<<<<<<<<<<<<<
* last_pos = 0
* while 1:
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 631, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_links = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "lxml/html/clean.py":624
+ /* "lxml/html/clean.py":632
* leading_text = ''
* links = []
* last_pos = 0 # <<<<<<<<<<<<<<
*/
__pyx_v_last_pos = 0;
- /* "lxml/html/clean.py":625
+ /* "lxml/html/clean.py":633
* links = []
* last_pos = 0
* while 1: # <<<<<<<<<<<<<<
*/
while (1) {
- /* "lxml/html/clean.py":626
+ /* "lxml/html/clean.py":634
* last_pos = 0
* while 1:
* best_match, best_pos = None, None # <<<<<<<<<<<<<<
__Pyx_XDECREF_SET(__pyx_v_best_pos, __pyx_t_2);
__pyx_t_2 = 0;
- /* "lxml/html/clean.py":627
+ /* "lxml/html/clean.py":635
* while 1:
* best_match, best_pos = None, None
* for regex in link_regexes: # <<<<<<<<<<<<<<
__pyx_t_2 = __pyx_v_link_regexes; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
__pyx_t_4 = NULL;
} else {
- __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_link_regexes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 627, __pyx_L1_error)
+ __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_link_regexes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 635, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 627, __pyx_L1_error)
+ __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 635, __pyx_L1_error)
}
for (;;) {
if (likely(!__pyx_t_4)) {
if (likely(PyList_CheckExact(__pyx_t_2))) {
if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 627, __pyx_L1_error)
+ __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 635, __pyx_L1_error)
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 627, __pyx_L1_error)
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
} else {
if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 627, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 635, __pyx_L1_error)
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 627, __pyx_L1_error)
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
}
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 627, __pyx_L1_error)
+ else __PYX_ERR(0, 635, __pyx_L1_error)
}
break;
}
__Pyx_XDECREF_SET(__pyx_v_regex, __pyx_t_1);
__pyx_t_1 = 0;
- /* "lxml/html/clean.py":628
+ /* "lxml/html/clean.py":636
* best_match, best_pos = None, None
* for regex in link_regexes:
* regex_pos = last_pos # <<<<<<<<<<<<<<
* while 1:
* match = regex.search(text, pos=regex_pos)
*/
- __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_last_pos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 628, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_last_pos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 636, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_XDECREF_SET(__pyx_v_regex_pos, __pyx_t_1);
__pyx_t_1 = 0;
- /* "lxml/html/clean.py":629
+ /* "lxml/html/clean.py":637
* for regex in link_regexes:
* regex_pos = last_pos
* while 1: # <<<<<<<<<<<<<<
*/
while (1) {
- /* "lxml/html/clean.py":630
+ /* "lxml/html/clean.py":638
* regex_pos = last_pos
* while 1:
* match = regex.search(text, pos=regex_pos) # <<<<<<<<<<<<<<
* if match is None:
* break
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_regex, __pyx_n_s_search); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 630, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_regex, __pyx_n_s_search); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 630, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 638, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(__pyx_v_text);
__Pyx_GIVEREF(__pyx_v_text);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_text);
- __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 630, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 638, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_pos, __pyx_v_regex_pos) < 0) __PYX_ERR(0, 630, __pyx_L1_error)
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 630, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_pos, __pyx_v_regex_pos) < 0) __PYX_ERR(0, 638, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 638, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_XDECREF_SET(__pyx_v_match, __pyx_t_7);
__pyx_t_7 = 0;
- /* "lxml/html/clean.py":631
+ /* "lxml/html/clean.py":639
* while 1:
* match = regex.search(text, pos=regex_pos)
* if match is None: # <<<<<<<<<<<<<<
__pyx_t_9 = (__pyx_t_8 != 0);
if (__pyx_t_9) {
- /* "lxml/html/clean.py":632
+ /* "lxml/html/clean.py":640
* match = regex.search(text, pos=regex_pos)
* if match is None:
* break # <<<<<<<<<<<<<<
*/
goto __pyx_L8_break;
- /* "lxml/html/clean.py":631
+ /* "lxml/html/clean.py":639
* while 1:
* match = regex.search(text, pos=regex_pos)
* if match is None: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":633
+ /* "lxml/html/clean.py":641
* if match is None:
* break
* host = match.group('host') # <<<<<<<<<<<<<<
* for host_regex in avoid_hosts:
* if host_regex.search(host):
*/
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_match, __pyx_n_s_group); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 633, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_match, __pyx_n_s_group); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 641, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
}
__pyx_t_7 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_n_s_host) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_n_s_host);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 633, __pyx_L1_error)
+ if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 641, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF_SET(__pyx_v_host, __pyx_t_7);
__pyx_t_7 = 0;
- /* "lxml/html/clean.py":634
+ /* "lxml/html/clean.py":642
* break
* host = match.group('host')
* for host_regex in avoid_hosts: # <<<<<<<<<<<<<<
__pyx_t_7 = __pyx_v_avoid_hosts; __Pyx_INCREF(__pyx_t_7); __pyx_t_10 = 0;
__pyx_t_11 = NULL;
} else {
- __pyx_t_10 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_avoid_hosts); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 634, __pyx_L1_error)
+ __pyx_t_10 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_avoid_hosts); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 642, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_11 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 634, __pyx_L1_error)
+ __pyx_t_11 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 642, __pyx_L1_error)
}
for (;;) {
if (likely(!__pyx_t_11)) {
if (likely(PyList_CheckExact(__pyx_t_7))) {
if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_7)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_6 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 634, __pyx_L1_error)
+ __pyx_t_6 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 642, __pyx_L1_error)
#else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 634, __pyx_L1_error)
+ __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 642, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
} else {
if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 634, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 642, __pyx_L1_error)
#else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 634, __pyx_L1_error)
+ __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 642, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
}
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 634, __pyx_L1_error)
+ else __PYX_ERR(0, 642, __pyx_L1_error)
}
break;
}
__Pyx_XDECREF_SET(__pyx_v_host_regex, __pyx_t_6);
__pyx_t_6 = 0;
- /* "lxml/html/clean.py":635
+ /* "lxml/html/clean.py":643
* host = match.group('host')
* for host_regex in avoid_hosts:
* if host_regex.search(host): # <<<<<<<<<<<<<<
* regex_pos = match.end()
* break
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_host_regex, __pyx_n_s_search); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 635, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_host_regex, __pyx_n_s_search); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 643, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
}
__pyx_t_6 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_1, __pyx_v_host) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_host);
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 635, __pyx_L1_error)
+ if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 643, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 635, __pyx_L1_error)
+ __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 643, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_9) {
- /* "lxml/html/clean.py":636
+ /* "lxml/html/clean.py":644
* for host_regex in avoid_hosts:
* if host_regex.search(host):
* regex_pos = match.end() # <<<<<<<<<<<<<<
* break
* else:
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_match, __pyx_n_s_end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 636, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_match, __pyx_n_s_end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 644, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
}
__pyx_t_6 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 636, __pyx_L1_error)
+ if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 644, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF_SET(__pyx_v_regex_pos, __pyx_t_6);
__pyx_t_6 = 0;
- /* "lxml/html/clean.py":637
+ /* "lxml/html/clean.py":645
* if host_regex.search(host):
* regex_pos = match.end()
* break # <<<<<<<<<<<<<<
*/
goto __pyx_L11_break;
- /* "lxml/html/clean.py":635
+ /* "lxml/html/clean.py":643
* host = match.group('host')
* for host_regex in avoid_hosts:
* if host_regex.search(host): # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":634
+ /* "lxml/html/clean.py":642
* break
* host = match.group('host')
* for host_regex in avoid_hosts: # <<<<<<<<<<<<<<
}
/*else*/ {
- /* "lxml/html/clean.py":639
+ /* "lxml/html/clean.py":647
* break
* else:
* break # <<<<<<<<<<<<<<
goto __pyx_L8_break;
}
- /* "lxml/html/clean.py":634
+ /* "lxml/html/clean.py":642
* break
* host = match.group('host')
* for host_regex in avoid_hosts: # <<<<<<<<<<<<<<
}
__pyx_L8_break:;
- /* "lxml/html/clean.py":640
+ /* "lxml/html/clean.py":648
* else:
* break
* if match is None: # <<<<<<<<<<<<<<
* continue
* if best_pos is None or match.start() < best_pos:
*/
- if (unlikely(!__pyx_v_match)) { __Pyx_RaiseUnboundLocalError("match"); __PYX_ERR(0, 640, __pyx_L1_error) }
+ if (unlikely(!__pyx_v_match)) { __Pyx_RaiseUnboundLocalError("match"); __PYX_ERR(0, 648, __pyx_L1_error) }
__pyx_t_9 = (__pyx_v_match == Py_None);
__pyx_t_8 = (__pyx_t_9 != 0);
if (__pyx_t_8) {
- /* "lxml/html/clean.py":641
+ /* "lxml/html/clean.py":649
* break
* if match is None:
* continue # <<<<<<<<<<<<<<
*/
goto __pyx_L5_continue;
- /* "lxml/html/clean.py":640
+ /* "lxml/html/clean.py":648
* else:
* break
* if match is None: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":642
+ /* "lxml/html/clean.py":650
* if match is None:
* continue
* if best_pos is None or match.start() < best_pos: # <<<<<<<<<<<<<<
__pyx_t_8 = __pyx_t_12;
goto __pyx_L16_bool_binop_done;
}
- if (unlikely(!__pyx_v_match)) { __Pyx_RaiseUnboundLocalError("match"); __PYX_ERR(0, 642, __pyx_L1_error) }
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_match, __pyx_n_s_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 642, __pyx_L1_error)
+ if (unlikely(!__pyx_v_match)) { __Pyx_RaiseUnboundLocalError("match"); __PYX_ERR(0, 650, __pyx_L1_error) }
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_match, __pyx_n_s_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 650, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
}
__pyx_t_7 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 642, __pyx_L1_error)
+ if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 650, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyObject_RichCompare(__pyx_t_7, __pyx_v_best_pos, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 642, __pyx_L1_error)
+ __pyx_t_6 = PyObject_RichCompare(__pyx_t_7, __pyx_v_best_pos, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 650, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 642, __pyx_L1_error)
+ __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 650, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_8 = __pyx_t_12;
__pyx_L16_bool_binop_done:;
if (__pyx_t_8) {
- /* "lxml/html/clean.py":643
+ /* "lxml/html/clean.py":651
* continue
* if best_pos is None or match.start() < best_pos:
* best_match = match # <<<<<<<<<<<<<<
* best_pos = match.start()
* if best_match is None:
*/
- if (unlikely(!__pyx_v_match)) { __Pyx_RaiseUnboundLocalError("match"); __PYX_ERR(0, 643, __pyx_L1_error) }
+ if (unlikely(!__pyx_v_match)) { __Pyx_RaiseUnboundLocalError("match"); __PYX_ERR(0, 651, __pyx_L1_error) }
__Pyx_INCREF(__pyx_v_match);
__Pyx_DECREF_SET(__pyx_v_best_match, __pyx_v_match);
- /* "lxml/html/clean.py":644
+ /* "lxml/html/clean.py":652
* if best_pos is None or match.start() < best_pos:
* best_match = match
* best_pos = match.start() # <<<<<<<<<<<<<<
* if best_match is None:
* # No more matches
*/
- if (unlikely(!__pyx_v_match)) { __Pyx_RaiseUnboundLocalError("match"); __PYX_ERR(0, 644, __pyx_L1_error) }
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_match, __pyx_n_s_start); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 644, __pyx_L1_error)
+ if (unlikely(!__pyx_v_match)) { __Pyx_RaiseUnboundLocalError("match"); __PYX_ERR(0, 652, __pyx_L1_error) }
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_match, __pyx_n_s_start); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 652, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
}
__pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 644, __pyx_L1_error)
+ if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 652, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF_SET(__pyx_v_best_pos, __pyx_t_6);
__pyx_t_6 = 0;
- /* "lxml/html/clean.py":642
+ /* "lxml/html/clean.py":650
* if match is None:
* continue
* if best_pos is None or match.start() < best_pos: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":627
+ /* "lxml/html/clean.py":635
* while 1:
* best_match, best_pos = None, None
* for regex in link_regexes: # <<<<<<<<<<<<<<
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "lxml/html/clean.py":645
+ /* "lxml/html/clean.py":653
* best_match = match
* best_pos = match.start()
* if best_match is None: # <<<<<<<<<<<<<<
__pyx_t_12 = (__pyx_t_8 != 0);
if (__pyx_t_12) {
- /* "lxml/html/clean.py":647
+ /* "lxml/html/clean.py":655
* if best_match is None:
* # No more matches
* if links: # <<<<<<<<<<<<<<
__pyx_t_12 = (PyList_GET_SIZE(__pyx_v_links) != 0);
if (__pyx_t_12) {
- /* "lxml/html/clean.py":648
+ /* "lxml/html/clean.py":656
* # No more matches
* if links:
* assert not links[-1].tail # <<<<<<<<<<<<<<
*/
#ifndef CYTHON_WITHOUT_ASSERTIONS
if (unlikely(!Py_OptimizeFlag)) {
- __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_links, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 648, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_links, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 656, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_tail); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 648, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_tail); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 656, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 648, __pyx_L1_error)
+ __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 656, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!((!__pyx_t_12) != 0))) {
PyErr_SetNone(PyExc_AssertionError);
- __PYX_ERR(0, 648, __pyx_L1_error)
+ __PYX_ERR(0, 656, __pyx_L1_error)
}
}
#endif
- /* "lxml/html/clean.py":649
+ /* "lxml/html/clean.py":657
* if links:
* assert not links[-1].tail
* links[-1].tail = text # <<<<<<<<<<<<<<
* else:
* assert not leading_text
*/
- __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_links, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 649, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_links, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 657, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- if (__Pyx_PyObject_SetAttrStr(__pyx_t_6, __pyx_n_s_tail, __pyx_v_text) < 0) __PYX_ERR(0, 649, __pyx_L1_error)
+ if (__Pyx_PyObject_SetAttrStr(__pyx_t_6, __pyx_n_s_tail, __pyx_v_text) < 0) __PYX_ERR(0, 657, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "lxml/html/clean.py":647
+ /* "lxml/html/clean.py":655
* if best_match is None:
* # No more matches
* if links: # <<<<<<<<<<<<<<
goto __pyx_L19;
}
- /* "lxml/html/clean.py":651
+ /* "lxml/html/clean.py":659
* links[-1].tail = text
* else:
* assert not leading_text # <<<<<<<<<<<<<<
/*else*/ {
#ifndef CYTHON_WITHOUT_ASSERTIONS
if (unlikely(!Py_OptimizeFlag)) {
- __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_leading_text); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 651, __pyx_L1_error)
+ __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_leading_text); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 659, __pyx_L1_error)
if (unlikely(!((!__pyx_t_12) != 0))) {
PyErr_SetNone(PyExc_AssertionError);
- __PYX_ERR(0, 651, __pyx_L1_error)
+ __PYX_ERR(0, 659, __pyx_L1_error)
}
}
#endif
- /* "lxml/html/clean.py":652
+ /* "lxml/html/clean.py":660
* else:
* assert not leading_text
* leading_text = text # <<<<<<<<<<<<<<
}
__pyx_L19:;
- /* "lxml/html/clean.py":653
+ /* "lxml/html/clean.py":661
* assert not leading_text
* leading_text = text
* break # <<<<<<<<<<<<<<
*/
goto __pyx_L4_break;
- /* "lxml/html/clean.py":645
+ /* "lxml/html/clean.py":653
* best_match = match
* best_pos = match.start()
* if best_match is None: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":654
+ /* "lxml/html/clean.py":662
* leading_text = text
* break
* link = best_match.group(0) # <<<<<<<<<<<<<<
* end = best_match.end()
* if link.endswith('.') or link.endswith(','):
*/
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_best_match, __pyx_n_s_group); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 654, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_best_match, __pyx_n_s_group); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 662, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
}
__pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_int_0);
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 654, __pyx_L1_error)
+ if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 662, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF_SET(__pyx_v_link, __pyx_t_6);
__pyx_t_6 = 0;
- /* "lxml/html/clean.py":655
+ /* "lxml/html/clean.py":663
* break
* link = best_match.group(0)
* end = best_match.end() # <<<<<<<<<<<<<<
* if link.endswith('.') or link.endswith(','):
* # These punctuation marks shouldn't end a link
*/
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_best_match, __pyx_n_s_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 655, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_best_match, __pyx_n_s_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
}
__pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 655, __pyx_L1_error)
+ if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 663, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF_SET(__pyx_v_end, __pyx_t_6);
__pyx_t_6 = 0;
- /* "lxml/html/clean.py":656
+ /* "lxml/html/clean.py":664
* link = best_match.group(0)
* end = best_match.end()
* if link.endswith('.') or link.endswith(','): # <<<<<<<<<<<<<<
* # These punctuation marks shouldn't end a link
* end -= 1
*/
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_link, __pyx_n_s_endswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 656, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_link, __pyx_n_s_endswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 664, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
}
__pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_kp_s__15) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s__15);
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 656, __pyx_L1_error)
+ if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 664, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 656, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 664, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (!__pyx_t_8) {
} else {
__pyx_t_12 = __pyx_t_8;
goto __pyx_L21_bool_binop_done;
}
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_link, __pyx_n_s_endswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 656, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_link, __pyx_n_s_endswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 664, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
}
__pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_kp_s__16) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s__16);
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 656, __pyx_L1_error)
+ if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 664, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 656, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 664, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_12 = __pyx_t_8;
__pyx_L21_bool_binop_done:;
if (__pyx_t_12) {
- /* "lxml/html/clean.py":658
+ /* "lxml/html/clean.py":666
* if link.endswith('.') or link.endswith(','):
* # These punctuation marks shouldn't end a link
* end -= 1 # <<<<<<<<<<<<<<
* link = link[:-1]
* prev_text = text[:best_match.start()]
*/
- __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_v_end, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 658, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_v_end, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 666, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF_SET(__pyx_v_end, __pyx_t_6);
__pyx_t_6 = 0;
- /* "lxml/html/clean.py":659
+ /* "lxml/html/clean.py":667
* # These punctuation marks shouldn't end a link
* end -= 1
* link = link[:-1] # <<<<<<<<<<<<<<
* prev_text = text[:best_match.start()]
* if links:
*/
- __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_link, 0, -1L, NULL, NULL, &__pyx_slice__17, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 659, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_link, 0, -1L, NULL, NULL, &__pyx_slice__17, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 667, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF_SET(__pyx_v_link, __pyx_t_6);
__pyx_t_6 = 0;
- /* "lxml/html/clean.py":656
+ /* "lxml/html/clean.py":664
* link = best_match.group(0)
* end = best_match.end()
* if link.endswith('.') or link.endswith(','): # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":660
+ /* "lxml/html/clean.py":668
* end -= 1
* link = link[:-1]
* prev_text = text[:best_match.start()] # <<<<<<<<<<<<<<
* if links:
* assert not links[-1].tail
*/
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_best_match, __pyx_n_s_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 660, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_best_match, __pyx_n_s_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 668, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
}
__pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 660, __pyx_L1_error)
+ if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_text, 0, 0, NULL, &__pyx_t_6, NULL, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 660, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_text, 0, 0, NULL, &__pyx_t_6, NULL, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 668, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF_SET(__pyx_v_prev_text, __pyx_t_2);
__pyx_t_2 = 0;
- /* "lxml/html/clean.py":661
+ /* "lxml/html/clean.py":669
* link = link[:-1]
* prev_text = text[:best_match.start()]
* if links: # <<<<<<<<<<<<<<
__pyx_t_12 = (PyList_GET_SIZE(__pyx_v_links) != 0);
if (__pyx_t_12) {
- /* "lxml/html/clean.py":662
+ /* "lxml/html/clean.py":670
* prev_text = text[:best_match.start()]
* if links:
* assert not links[-1].tail # <<<<<<<<<<<<<<
*/
#ifndef CYTHON_WITHOUT_ASSERTIONS
if (unlikely(!Py_OptimizeFlag)) {
- __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_links, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 662, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_links, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 670, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_tail); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 662, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_tail); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 670, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 662, __pyx_L1_error)
+ __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 670, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!((!__pyx_t_12) != 0))) {
PyErr_SetNone(PyExc_AssertionError);
- __PYX_ERR(0, 662, __pyx_L1_error)
+ __PYX_ERR(0, 670, __pyx_L1_error)
}
}
#endif
- /* "lxml/html/clean.py":663
+ /* "lxml/html/clean.py":671
* if links:
* assert not links[-1].tail
* links[-1].tail = prev_text # <<<<<<<<<<<<<<
* else:
* assert not leading_text
*/
- __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_links, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 663, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_links, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 671, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- if (__Pyx_PyObject_SetAttrStr(__pyx_t_6, __pyx_n_s_tail, __pyx_v_prev_text) < 0) __PYX_ERR(0, 663, __pyx_L1_error)
+ if (__Pyx_PyObject_SetAttrStr(__pyx_t_6, __pyx_n_s_tail, __pyx_v_prev_text) < 0) __PYX_ERR(0, 671, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "lxml/html/clean.py":661
+ /* "lxml/html/clean.py":669
* link = link[:-1]
* prev_text = text[:best_match.start()]
* if links: # <<<<<<<<<<<<<<
goto __pyx_L23;
}
- /* "lxml/html/clean.py":665
+ /* "lxml/html/clean.py":673
* links[-1].tail = prev_text
* else:
* assert not leading_text # <<<<<<<<<<<<<<
/*else*/ {
#ifndef CYTHON_WITHOUT_ASSERTIONS
if (unlikely(!Py_OptimizeFlag)) {
- __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_leading_text); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 665, __pyx_L1_error)
+ __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_leading_text); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 673, __pyx_L1_error)
if (unlikely(!((!__pyx_t_12) != 0))) {
PyErr_SetNone(PyExc_AssertionError);
- __PYX_ERR(0, 665, __pyx_L1_error)
+ __PYX_ERR(0, 673, __pyx_L1_error)
}
}
#endif
- /* "lxml/html/clean.py":666
+ /* "lxml/html/clean.py":674
* else:
* assert not leading_text
* leading_text = prev_text # <<<<<<<<<<<<<<
}
__pyx_L23:;
- /* "lxml/html/clean.py":667
+ /* "lxml/html/clean.py":675
* assert not leading_text
* leading_text = prev_text
* anchor = factory('a') # <<<<<<<<<<<<<<
}
__pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_n_s_a) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_s_a);
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 667, __pyx_L1_error)
+ if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 675, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF_SET(__pyx_v_anchor, __pyx_t_6);
__pyx_t_6 = 0;
- /* "lxml/html/clean.py":668
+ /* "lxml/html/clean.py":676
* leading_text = prev_text
* anchor = factory('a')
* anchor.set('href', link) # <<<<<<<<<<<<<<
* body = best_match.group('body')
* if not body:
*/
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_anchor, __pyx_n_s_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 668, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_anchor, __pyx_n_s_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 676, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_7 = NULL;
__pyx_t_13 = 0;
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_n_s_href, __pyx_v_link};
- __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 676, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_n_s_href, __pyx_v_link};
- __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 676, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else
#endif
{
- __pyx_t_5 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 668, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 676, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (__pyx_t_7) {
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
__Pyx_INCREF(__pyx_v_link);
__Pyx_GIVEREF(__pyx_v_link);
PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_13, __pyx_v_link);
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 676, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "lxml/html/clean.py":669
+ /* "lxml/html/clean.py":677
* anchor = factory('a')
* anchor.set('href', link)
* body = best_match.group('body') # <<<<<<<<<<<<<<
* if not body:
* body = link
*/
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_best_match, __pyx_n_s_group); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 669, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_best_match, __pyx_n_s_group); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 677, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
}
__pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_n_s_body) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_s_body);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 669, __pyx_L1_error)
+ if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 677, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF_SET(__pyx_v_body, __pyx_t_6);
__pyx_t_6 = 0;
- /* "lxml/html/clean.py":670
+ /* "lxml/html/clean.py":678
* anchor.set('href', link)
* body = best_match.group('body')
* if not body: # <<<<<<<<<<<<<<
* body = link
* if body.endswith('.') or body.endswith(','):
*/
- __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_body); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 670, __pyx_L1_error)
+ __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_body); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 678, __pyx_L1_error)
__pyx_t_8 = ((!__pyx_t_12) != 0);
if (__pyx_t_8) {
- /* "lxml/html/clean.py":671
+ /* "lxml/html/clean.py":679
* body = best_match.group('body')
* if not body:
* body = link # <<<<<<<<<<<<<<
__Pyx_INCREF(__pyx_v_link);
__Pyx_DECREF_SET(__pyx_v_body, __pyx_v_link);
- /* "lxml/html/clean.py":670
+ /* "lxml/html/clean.py":678
* anchor.set('href', link)
* body = best_match.group('body')
* if not body: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":672
+ /* "lxml/html/clean.py":680
* if not body:
* body = link
* if body.endswith('.') or body.endswith(','): # <<<<<<<<<<<<<<
* body = body[:-1]
* anchor.text = body
*/
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_body, __pyx_n_s_endswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 672, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_body, __pyx_n_s_endswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
}
__pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_kp_s__15) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s__15);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 672, __pyx_L1_error)
+ if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 680, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 672, __pyx_L1_error)
+ __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 680, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (!__pyx_t_12) {
} else {
__pyx_t_8 = __pyx_t_12;
goto __pyx_L26_bool_binop_done;
}
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_body, __pyx_n_s_endswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 672, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_body, __pyx_n_s_endswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
}
__pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_kp_s__16) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s__16);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 672, __pyx_L1_error)
+ if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 680, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 672, __pyx_L1_error)
+ __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 680, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_8 = __pyx_t_12;
__pyx_L26_bool_binop_done:;
if (__pyx_t_8) {
- /* "lxml/html/clean.py":673
+ /* "lxml/html/clean.py":681
* body = link
* if body.endswith('.') or body.endswith(','):
* body = body[:-1] # <<<<<<<<<<<<<<
* anchor.text = body
* links.append(anchor)
*/
- __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_body, 0, -1L, NULL, NULL, &__pyx_slice__17, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 673, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_body, 0, -1L, NULL, NULL, &__pyx_slice__17, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 681, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF_SET(__pyx_v_body, __pyx_t_6);
__pyx_t_6 = 0;
- /* "lxml/html/clean.py":672
+ /* "lxml/html/clean.py":680
* if not body:
* body = link
* if body.endswith('.') or body.endswith(','): # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":674
+ /* "lxml/html/clean.py":682
* if body.endswith('.') or body.endswith(','):
* body = body[:-1]
* anchor.text = body # <<<<<<<<<<<<<<
* links.append(anchor)
* text = text[end:]
*/
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_anchor, __pyx_n_s_text, __pyx_v_body) < 0) __PYX_ERR(0, 674, __pyx_L1_error)
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_anchor, __pyx_n_s_text, __pyx_v_body) < 0) __PYX_ERR(0, 682, __pyx_L1_error)
- /* "lxml/html/clean.py":675
+ /* "lxml/html/clean.py":683
* body = body[:-1]
* anchor.text = body
* links.append(anchor) # <<<<<<<<<<<<<<
* text = text[end:]
* return leading_text, links
*/
- __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_links, __pyx_v_anchor); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 675, __pyx_L1_error)
+ __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_links, __pyx_v_anchor); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 683, __pyx_L1_error)
- /* "lxml/html/clean.py":676
+ /* "lxml/html/clean.py":684
* anchor.text = body
* links.append(anchor)
* text = text[end:] # <<<<<<<<<<<<<<
* return leading_text, links
*
*/
- __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_text, 0, 0, &__pyx_v_end, NULL, NULL, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 676, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_text, 0, 0, &__pyx_v_end, NULL, NULL, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 684, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF_SET(__pyx_v_text, __pyx_t_6);
__pyx_t_6 = 0;
}
__pyx_L4_break:;
- /* "lxml/html/clean.py":677
+ /* "lxml/html/clean.py":685
* links.append(anchor)
* text = text[end:]
* return leading_text, links # <<<<<<<<<<<<<<
* def autolink_html(html, *args, **kw):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 677, __pyx_L1_error)
+ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 685, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(__pyx_v_leading_text);
__Pyx_GIVEREF(__pyx_v_leading_text);
__pyx_t_6 = 0;
goto __pyx_L0;
- /* "lxml/html/clean.py":621
+ /* "lxml/html/clean.py":629
* el[:0] = pre_children
*
* def _link_text(text, link_regexes, avoid_hosts, factory): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "lxml/html/clean.py":679
+/* "lxml/html/clean.py":687
* return leading_text, links
*
* def autolink_html(html, *args, **kw): # <<<<<<<<<<<<<<
}
if (unlikely(kw_args > 0)) {
const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, used_pos_args, "autolink_html") < 0)) __PYX_ERR(0, 679, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, used_pos_args, "autolink_html") < 0)) __PYX_ERR(0, 687, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
goto __pyx_L5_argtuple_error;
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("autolink_html", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 679, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("autolink_html", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 687, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
__Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("autolink_html", 0);
- /* "lxml/html/clean.py":680
+ /* "lxml/html/clean.py":688
*
* def autolink_html(html, *args, **kw):
* result_type = type(html) # <<<<<<<<<<<<<<
__Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_html)));
__pyx_v_result_type = ((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_v_html)));
- /* "lxml/html/clean.py":681
+ /* "lxml/html/clean.py":689
* def autolink_html(html, *args, **kw):
* result_type = type(html)
* if isinstance(html, basestring): # <<<<<<<<<<<<<<
* doc = fromstring(html)
* else:
*/
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_basestring); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 681, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_basestring); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_IsInstance(__pyx_v_html, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 681, __pyx_L1_error)
+ __pyx_t_2 = PyObject_IsInstance(__pyx_v_html, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 689, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
- /* "lxml/html/clean.py":682
+ /* "lxml/html/clean.py":690
* result_type = type(html)
* if isinstance(html, basestring):
* doc = fromstring(html) # <<<<<<<<<<<<<<
* else:
* doc = copy.deepcopy(html)
*/
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_fromstring); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 682, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_fromstring); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 690, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
}
__pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_html) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_html);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 682, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_doc = __pyx_t_1;
__pyx_t_1 = 0;
- /* "lxml/html/clean.py":681
+ /* "lxml/html/clean.py":689
* def autolink_html(html, *args, **kw):
* result_type = type(html)
* if isinstance(html, basestring): # <<<<<<<<<<<<<<
goto __pyx_L3;
}
- /* "lxml/html/clean.py":684
+ /* "lxml/html/clean.py":692
* doc = fromstring(html)
* else:
* doc = copy.deepcopy(html) # <<<<<<<<<<<<<<
* return _transform_result(result_type, doc)
*/
/*else*/ {
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 684, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_deepcopy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 684, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_deepcopy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 692, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
}
__pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_html) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_html);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_doc = __pyx_t_1;
}
__pyx_L3:;
- /* "lxml/html/clean.py":685
+ /* "lxml/html/clean.py":693
* else:
* doc = copy.deepcopy(html)
* autolink(doc, *args, **kw) # <<<<<<<<<<<<<<
* return _transform_result(result_type, doc)
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_autolink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 685, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_autolink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 693, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 685, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 693, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(__pyx_v_doc);
__Pyx_GIVEREF(__pyx_v_doc);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_doc);
- __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 685, __pyx_L1_error)
+ __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 693, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_v_kw); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 685, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_v_kw); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 693, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":686
+ /* "lxml/html/clean.py":694
* doc = copy.deepcopy(html)
* autolink(doc, *args, **kw)
* return _transform_result(result_type, doc) # <<<<<<<<<<<<<<
* autolink_html.__doc__ = autolink.__doc__
*/
__Pyx_XDECREF(__pyx_r);
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_transform_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 686, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_transform_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 694, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_1 = NULL;
__pyx_t_6 = 0;
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[3] = {__pyx_t_1, ((PyObject *)__pyx_v_result_type), __pyx_v_doc};
- __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 686, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 694, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[3] = {__pyx_t_1, ((PyObject *)__pyx_v_result_type), __pyx_v_doc};
- __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 686, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 694, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
{
- __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 686, __pyx_L1_error)
+ __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 694, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (__pyx_t_1) {
__Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __pyx_t_1 = NULL;
__Pyx_INCREF(__pyx_v_doc);
__Pyx_GIVEREF(__pyx_v_doc);
PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_doc);
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 686, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 694, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
__pyx_t_5 = 0;
goto __pyx_L0;
- /* "lxml/html/clean.py":679
+ /* "lxml/html/clean.py":687
* return leading_text, links
*
* def autolink_html(html, *args, **kw): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "lxml/html/clean.py":697
+/* "lxml/html/clean.py":705
* _avoid_word_break_classes = ['nobreak']
*
* def word_break(el, max_width=40, # <<<<<<<<<<<<<<
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__defaults__", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 705, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_int_40));
__Pyx_GIVEREF(((PyObject *)__pyx_int_40));
__Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_break_character);
__Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_break_character);
PyTuple_SET_ITEM(__pyx_t_1, 3, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_break_character);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error)
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 705, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "word_break") < 0)) __PYX_ERR(0, 697, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "word_break") < 0)) __PYX_ERR(0, 705, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("word_break", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 697, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("word_break", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 705, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("lxml.html.clean.word_break", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("word_break", 0);
- /* "lxml/html/clean.py":716
+ /* "lxml/html/clean.py":724
* # Character suggestion of ​ comes from:
* # http://www.cs.tut.fi/~jkorpela/html/nobr.html
* if el.tag in _avoid_word_break_elements: # <<<<<<<<<<<<<<
* return
* class_name = el.get('class')
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 716, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 724, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_avoid_word_break_elements); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 716, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_avoid_word_break_elements); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 724, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 716, __pyx_L1_error)
+ __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 724, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
- /* "lxml/html/clean.py":717
+ /* "lxml/html/clean.py":725
* # http://www.cs.tut.fi/~jkorpela/html/nobr.html
* if el.tag in _avoid_word_break_elements:
* return # <<<<<<<<<<<<<<
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
- /* "lxml/html/clean.py":716
+ /* "lxml/html/clean.py":724
* # Character suggestion of ​ comes from:
* # http://www.cs.tut.fi/~jkorpela/html/nobr.html
* if el.tag in _avoid_word_break_elements: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":718
+ /* "lxml/html/clean.py":726
* if el.tag in _avoid_word_break_elements:
* return
* class_name = el.get('class') # <<<<<<<<<<<<<<
* if class_name:
* dont_break = False
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 718, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
}
__pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_n_s_class) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_n_s_class);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 718, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_class_name = __pyx_t_2;
__pyx_t_2 = 0;
- /* "lxml/html/clean.py":719
+ /* "lxml/html/clean.py":727
* return
* class_name = el.get('class')
* if class_name: # <<<<<<<<<<<<<<
* dont_break = False
* class_name = class_name.split()
*/
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_class_name); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 719, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_class_name); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 727, __pyx_L1_error)
if (__pyx_t_4) {
- /* "lxml/html/clean.py":720
+ /* "lxml/html/clean.py":728
* class_name = el.get('class')
* if class_name:
* dont_break = False # <<<<<<<<<<<<<<
*/
__pyx_v_dont_break = 0;
- /* "lxml/html/clean.py":721
+ /* "lxml/html/clean.py":729
* if class_name:
* dont_break = False
* class_name = class_name.split() # <<<<<<<<<<<<<<
* for avoid in avoid_classes:
* if avoid in class_name:
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_class_name, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_class_name, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 729, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
}
__pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 721, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 729, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF_SET(__pyx_v_class_name, __pyx_t_2);
__pyx_t_2 = 0;
- /* "lxml/html/clean.py":722
+ /* "lxml/html/clean.py":730
* dont_break = False
* class_name = class_name.split()
* for avoid in avoid_classes: # <<<<<<<<<<<<<<
__pyx_t_2 = __pyx_v_avoid_classes; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
__pyx_t_7 = NULL;
} else {
- __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_avoid_classes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 722, __pyx_L1_error)
+ __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_avoid_classes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 722, __pyx_L1_error)
+ __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 730, __pyx_L1_error)
}
for (;;) {
if (likely(!__pyx_t_7)) {
if (likely(PyList_CheckExact(__pyx_t_2))) {
if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 722, __pyx_L1_error)
+ __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 730, __pyx_L1_error)
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error)
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
} else {
if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 722, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 730, __pyx_L1_error)
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error)
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
}
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 722, __pyx_L1_error)
+ else __PYX_ERR(0, 730, __pyx_L1_error)
}
break;
}
__Pyx_XDECREF_SET(__pyx_v_avoid, __pyx_t_1);
__pyx_t_1 = 0;
- /* "lxml/html/clean.py":723
+ /* "lxml/html/clean.py":731
* class_name = class_name.split()
* for avoid in avoid_classes:
* if avoid in class_name: # <<<<<<<<<<<<<<
* dont_break = True
* break
*/
- __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_avoid, __pyx_v_class_name, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 723, __pyx_L1_error)
+ __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_avoid, __pyx_v_class_name, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 731, __pyx_L1_error)
__pyx_t_3 = (__pyx_t_4 != 0);
if (__pyx_t_3) {
- /* "lxml/html/clean.py":724
+ /* "lxml/html/clean.py":732
* for avoid in avoid_classes:
* if avoid in class_name:
* dont_break = True # <<<<<<<<<<<<<<
*/
__pyx_v_dont_break = 1;
- /* "lxml/html/clean.py":725
+ /* "lxml/html/clean.py":733
* if avoid in class_name:
* dont_break = True
* break # <<<<<<<<<<<<<<
*/
goto __pyx_L6_break;
- /* "lxml/html/clean.py":723
+ /* "lxml/html/clean.py":731
* class_name = class_name.split()
* for avoid in avoid_classes:
* if avoid in class_name: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":722
+ /* "lxml/html/clean.py":730
* dont_break = False
* class_name = class_name.split()
* for avoid in avoid_classes: # <<<<<<<<<<<<<<
__pyx_L6_break:;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "lxml/html/clean.py":726
+ /* "lxml/html/clean.py":734
* dont_break = True
* break
* if dont_break: # <<<<<<<<<<<<<<
__pyx_t_3 = (__pyx_v_dont_break != 0);
if (__pyx_t_3) {
- /* "lxml/html/clean.py":727
+ /* "lxml/html/clean.py":735
* break
* if dont_break:
* return # <<<<<<<<<<<<<<
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
- /* "lxml/html/clean.py":726
+ /* "lxml/html/clean.py":734
* dont_break = True
* break
* if dont_break: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":719
+ /* "lxml/html/clean.py":727
* return
* class_name = el.get('class')
* if class_name: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":728
+ /* "lxml/html/clean.py":736
* if dont_break:
* return
* if el.text: # <<<<<<<<<<<<<<
* el.text = _break_text(el.text, max_width, break_character)
* for child in el:
*/
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 728, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 736, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 728, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 736, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_3) {
- /* "lxml/html/clean.py":729
+ /* "lxml/html/clean.py":737
* return
* if el.text:
* el.text = _break_text(el.text, max_width, break_character) # <<<<<<<<<<<<<<
* for child in el:
* word_break(child, max_width=max_width,
*/
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_break_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 729, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_break_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 737, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_text); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 729, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_text); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 737, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_8 = NULL;
__pyx_t_9 = 0;
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_1)) {
PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_5, __pyx_v_max_width, __pyx_v_break_character};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 729, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 737, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_5, __pyx_v_max_width, __pyx_v_break_character};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 729, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 737, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
{
- __pyx_t_10 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 729, __pyx_L1_error)
+ __pyx_t_10 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 737, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
if (__pyx_t_8) {
__Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
__Pyx_GIVEREF(__pyx_v_break_character);
PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_v_break_character);
__pyx_t_5 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 729, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 737, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_text, __pyx_t_2) < 0) __PYX_ERR(0, 729, __pyx_L1_error)
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_text, __pyx_t_2) < 0) __PYX_ERR(0, 737, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "lxml/html/clean.py":728
+ /* "lxml/html/clean.py":736
* if dont_break:
* return
* if el.text: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":730
+ /* "lxml/html/clean.py":738
* if el.text:
* el.text = _break_text(el.text, max_width, break_character)
* for child in el: # <<<<<<<<<<<<<<
__pyx_t_2 = __pyx_v_el; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
__pyx_t_7 = NULL;
} else {
- __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_el); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
+ __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_el); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 738, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 730, __pyx_L1_error)
+ __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 738, __pyx_L1_error)
}
for (;;) {
if (likely(!__pyx_t_7)) {
if (likely(PyList_CheckExact(__pyx_t_2))) {
if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 730, __pyx_L1_error)
+ __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 738, __pyx_L1_error)
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 738, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
} else {
if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 730, __pyx_L1_error)
+ __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 738, __pyx_L1_error)
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 738, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
}
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 730, __pyx_L1_error)
+ else __PYX_ERR(0, 738, __pyx_L1_error)
}
break;
}
__Pyx_XDECREF_SET(__pyx_v_child, __pyx_t_1);
__pyx_t_1 = 0;
- /* "lxml/html/clean.py":731
+ /* "lxml/html/clean.py":739
* el.text = _break_text(el.text, max_width, break_character)
* for child in el:
* word_break(child, max_width=max_width, # <<<<<<<<<<<<<<
* avoid_elements=avoid_elements,
* avoid_classes=avoid_classes,
*/
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_word_break); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 731, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_word_break); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 739, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 731, __pyx_L1_error)
+ __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 739, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_INCREF(__pyx_v_child);
__Pyx_GIVEREF(__pyx_v_child);
PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_child);
- __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 731, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 739, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_max_width, __pyx_v_max_width) < 0) __PYX_ERR(0, 731, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_max_width, __pyx_v_max_width) < 0) __PYX_ERR(0, 739, __pyx_L1_error)
- /* "lxml/html/clean.py":732
+ /* "lxml/html/clean.py":740
* for child in el:
* word_break(child, max_width=max_width,
* avoid_elements=avoid_elements, # <<<<<<<<<<<<<<
* avoid_classes=avoid_classes,
* break_character=break_character)
*/
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_avoid_elements, __pyx_v_avoid_elements) < 0) __PYX_ERR(0, 731, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_avoid_elements, __pyx_v_avoid_elements) < 0) __PYX_ERR(0, 739, __pyx_L1_error)
- /* "lxml/html/clean.py":733
+ /* "lxml/html/clean.py":741
* word_break(child, max_width=max_width,
* avoid_elements=avoid_elements,
* avoid_classes=avoid_classes, # <<<<<<<<<<<<<<
* break_character=break_character)
* if child.tail:
*/
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_avoid_classes, __pyx_v_avoid_classes) < 0) __PYX_ERR(0, 731, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_avoid_classes, __pyx_v_avoid_classes) < 0) __PYX_ERR(0, 739, __pyx_L1_error)
- /* "lxml/html/clean.py":734
+ /* "lxml/html/clean.py":742
* avoid_elements=avoid_elements,
* avoid_classes=avoid_classes,
* break_character=break_character) # <<<<<<<<<<<<<<
* if child.tail:
* child.tail = _break_text(child.tail, max_width, break_character)
*/
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_break_character, __pyx_v_break_character) < 0) __PYX_ERR(0, 731, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_break_character, __pyx_v_break_character) < 0) __PYX_ERR(0, 739, __pyx_L1_error)
- /* "lxml/html/clean.py":731
+ /* "lxml/html/clean.py":739
* el.text = _break_text(el.text, max_width, break_character)
* for child in el:
* word_break(child, max_width=max_width, # <<<<<<<<<<<<<<
* avoid_elements=avoid_elements,
* avoid_classes=avoid_classes,
*/
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 731, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 739, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- /* "lxml/html/clean.py":735
+ /* "lxml/html/clean.py":743
* avoid_classes=avoid_classes,
* break_character=break_character)
* if child.tail: # <<<<<<<<<<<<<<
* child.tail = _break_text(child.tail, max_width, break_character)
*
*/
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_tail); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 735, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_tail); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 743, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 735, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 743, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (__pyx_t_3) {
- /* "lxml/html/clean.py":736
+ /* "lxml/html/clean.py":744
* break_character=break_character)
* if child.tail:
* child.tail = _break_text(child.tail, max_width, break_character) # <<<<<<<<<<<<<<
*
* def word_break_html(html, *args, **kw):
*/
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_break_text); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 736, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_break_text); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 744, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_tail); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 736, __pyx_L1_error)
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_tail); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 744, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_1 = NULL;
__pyx_t_9 = 0;
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_t_10, __pyx_v_max_width, __pyx_v_break_character};
- __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 736, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 744, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_t_10, __pyx_v_max_width, __pyx_v_break_character};
- __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 736, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 744, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
} else
#endif
{
- __pyx_t_11 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 736, __pyx_L1_error)
+ __pyx_t_11 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 744, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
if (__pyx_t_1) {
__Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1); __pyx_t_1 = NULL;
__Pyx_GIVEREF(__pyx_v_break_character);
PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_9, __pyx_v_break_character);
__pyx_t_10 = 0;
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 736, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 744, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_child, __pyx_n_s_tail, __pyx_t_8) < 0) __PYX_ERR(0, 736, __pyx_L1_error)
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_child, __pyx_n_s_tail, __pyx_t_8) < 0) __PYX_ERR(0, 744, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- /* "lxml/html/clean.py":735
+ /* "lxml/html/clean.py":743
* avoid_classes=avoid_classes,
* break_character=break_character)
* if child.tail: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":730
+ /* "lxml/html/clean.py":738
* if el.text:
* el.text = _break_text(el.text, max_width, break_character)
* for child in el: # <<<<<<<<<<<<<<
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "lxml/html/clean.py":697
+ /* "lxml/html/clean.py":705
* _avoid_word_break_classes = ['nobreak']
*
* def word_break(el, max_width=40, # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "lxml/html/clean.py":738
+/* "lxml/html/clean.py":746
* child.tail = _break_text(child.tail, max_width, break_character)
*
* def word_break_html(html, *args, **kw): # <<<<<<<<<<<<<<
}
if (unlikely(kw_args > 0)) {
const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, used_pos_args, "word_break_html") < 0)) __PYX_ERR(0, 738, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, used_pos_args, "word_break_html") < 0)) __PYX_ERR(0, 746, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
goto __pyx_L5_argtuple_error;
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("word_break_html", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 738, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("word_break_html", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 746, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
__Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("word_break_html", 0);
- /* "lxml/html/clean.py":739
+ /* "lxml/html/clean.py":747
*
* def word_break_html(html, *args, **kw):
* result_type = type(html) # <<<<<<<<<<<<<<
__Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_html)));
__pyx_v_result_type = ((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_v_html)));
- /* "lxml/html/clean.py":740
+ /* "lxml/html/clean.py":748
* def word_break_html(html, *args, **kw):
* result_type = type(html)
* doc = fromstring(html) # <<<<<<<<<<<<<<
* word_break(doc, *args, **kw)
* return _transform_result(result_type, doc)
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_fromstring); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 740, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_fromstring); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 748, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_html) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_html);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 740, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 748, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_doc = __pyx_t_1;
__pyx_t_1 = 0;
- /* "lxml/html/clean.py":741
+ /* "lxml/html/clean.py":749
* result_type = type(html)
* doc = fromstring(html)
* word_break(doc, *args, **kw) # <<<<<<<<<<<<<<
* return _transform_result(result_type, doc)
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_word_break); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 741, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_word_break); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 749, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 741, __pyx_L1_error)
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 749, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_doc);
__Pyx_GIVEREF(__pyx_v_doc);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_doc);
- __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 741, __pyx_L1_error)
+ __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 749, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_v_kw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 741, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_v_kw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 749, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "lxml/html/clean.py":742
+ /* "lxml/html/clean.py":750
* doc = fromstring(html)
* word_break(doc, *args, **kw)
* return _transform_result(result_type, doc) # <<<<<<<<<<<<<<
* def _break_text(text, max_width, break_character):
*/
__Pyx_XDECREF(__pyx_r);
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_transform_result); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 742, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_transform_result); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 750, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = NULL;
__pyx_t_4 = 0;
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_1, ((PyObject *)__pyx_v_result_type), __pyx_v_doc};
- __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 742, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 750, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_1, ((PyObject *)__pyx_v_result_type), __pyx_v_doc};
- __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 742, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 750, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
{
- __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 742, __pyx_L1_error)
+ __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 750, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (__pyx_t_1) {
__Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL;
__Pyx_INCREF(__pyx_v_doc);
__Pyx_GIVEREF(__pyx_v_doc);
PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_doc);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 742, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 750, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "lxml/html/clean.py":738
+ /* "lxml/html/clean.py":746
* child.tail = _break_text(child.tail, max_width, break_character)
*
* def word_break_html(html, *args, **kw): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "lxml/html/clean.py":744
+/* "lxml/html/clean.py":752
* return _transform_result(result_type, doc)
*
* def _break_text(text, max_width, break_character): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_width)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_break_text", 1, 3, 3, 1); __PYX_ERR(0, 744, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("_break_text", 1, 3, 3, 1); __PYX_ERR(0, 752, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_break_character)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_break_text", 1, 3, 3, 2); __PYX_ERR(0, 744, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("_break_text", 1, 3, 3, 2); __PYX_ERR(0, 752, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_break_text") < 0)) __PYX_ERR(0, 744, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_break_text") < 0)) __PYX_ERR(0, 752, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_break_text", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 744, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("_break_text", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 752, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("lxml.html.clean._break_text", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
__Pyx_RefNannySetupContext("_break_text", 0);
__Pyx_INCREF(__pyx_v_text);
- /* "lxml/html/clean.py":745
+ /* "lxml/html/clean.py":753
*
* def _break_text(text, max_width, break_character):
* words = text.split() # <<<<<<<<<<<<<<
* for word in words:
* if len(word) > max_width:
*/
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_text, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 745, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_text, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 745, __pyx_L1_error)
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 753, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_words = __pyx_t_1;
__pyx_t_1 = 0;
- /* "lxml/html/clean.py":746
+ /* "lxml/html/clean.py":754
* def _break_text(text, max_width, break_character):
* words = text.split()
* for word in words: # <<<<<<<<<<<<<<
__pyx_t_1 = __pyx_v_words; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
__pyx_t_5 = NULL;
} else {
- __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_words); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error)
+ __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_words); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 754, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 746, __pyx_L1_error)
+ __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 754, __pyx_L1_error)
}
for (;;) {
if (likely(!__pyx_t_5)) {
if (likely(PyList_CheckExact(__pyx_t_1))) {
if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 746, __pyx_L1_error)
+ __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 754, __pyx_L1_error)
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L1_error)
+ __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 754, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
#endif
} else {
if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 746, __pyx_L1_error)
+ __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 754, __pyx_L1_error)
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L1_error)
+ __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 754, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
#endif
}
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 746, __pyx_L1_error)
+ else __PYX_ERR(0, 754, __pyx_L1_error)
}
break;
}
__Pyx_XDECREF_SET(__pyx_v_word, __pyx_t_2);
__pyx_t_2 = 0;
- /* "lxml/html/clean.py":747
+ /* "lxml/html/clean.py":755
* words = text.split()
* for word in words:
* if len(word) > max_width: # <<<<<<<<<<<<<<
* replacement = _insert_break(word, max_width, break_character)
* text = text.replace(word, replacement)
*/
- __pyx_t_6 = PyObject_Length(__pyx_v_word); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 747, __pyx_L1_error)
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 747, __pyx_L1_error)
+ __pyx_t_6 = PyObject_Length(__pyx_v_word); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 755, __pyx_L1_error)
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 755, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_v_max_width, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 747, __pyx_L1_error)
+ __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_v_max_width, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 755, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 747, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 755, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_7) {
- /* "lxml/html/clean.py":748
+ /* "lxml/html/clean.py":756
* for word in words:
* if len(word) > max_width:
* replacement = _insert_break(word, max_width, break_character) # <<<<<<<<<<<<<<
* text = text.replace(word, replacement)
* return text
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_insert_break); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 748, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_insert_break); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 756, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_8 = NULL;
__pyx_t_9 = 0;
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_v_word, __pyx_v_max_width, __pyx_v_break_character};
- __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 748, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 756, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_v_word, __pyx_v_max_width, __pyx_v_break_character};
- __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 748, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 756, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else
#endif
{
- __pyx_t_10 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 748, __pyx_L1_error)
+ __pyx_t_10 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 756, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
if (__pyx_t_8) {
__Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
__Pyx_INCREF(__pyx_v_break_character);
__Pyx_GIVEREF(__pyx_v_break_character);
PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_v_break_character);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 748, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 756, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
}
__Pyx_XDECREF_SET(__pyx_v_replacement, __pyx_t_3);
__pyx_t_3 = 0;
- /* "lxml/html/clean.py":749
+ /* "lxml/html/clean.py":757
* if len(word) > max_width:
* replacement = _insert_break(word, max_width, break_character)
* text = text.replace(word, replacement) # <<<<<<<<<<<<<<
* return text
*
*/
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_text, __pyx_n_s_replace); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 749, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_text, __pyx_n_s_replace); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 757, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_10 = NULL;
__pyx_t_9 = 0;
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_word, __pyx_v_replacement};
- __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 749, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 757, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_word, __pyx_v_replacement};
- __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 749, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 757, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else
#endif
{
- __pyx_t_8 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 749, __pyx_L1_error)
+ __pyx_t_8 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 757, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
if (__pyx_t_10) {
__Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10); __pyx_t_10 = NULL;
__Pyx_INCREF(__pyx_v_replacement);
__Pyx_GIVEREF(__pyx_v_replacement);
PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_9, __pyx_v_replacement);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 749, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 757, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
__Pyx_DECREF_SET(__pyx_v_text, __pyx_t_3);
__pyx_t_3 = 0;
- /* "lxml/html/clean.py":747
+ /* "lxml/html/clean.py":755
* words = text.split()
* for word in words:
* if len(word) > max_width: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":746
+ /* "lxml/html/clean.py":754
* def _break_text(text, max_width, break_character):
* words = text.split()
* for word in words: # <<<<<<<<<<<<<<
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "lxml/html/clean.py":750
+ /* "lxml/html/clean.py":758
* replacement = _insert_break(word, max_width, break_character)
* text = text.replace(word, replacement)
* return text # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_text;
goto __pyx_L0;
- /* "lxml/html/clean.py":744
+ /* "lxml/html/clean.py":752
* return _transform_result(result_type, doc)
*
* def _break_text(text, max_width, break_character): # <<<<<<<<<<<<<<
return __pyx_r;
}
-/* "lxml/html/clean.py":754
+/* "lxml/html/clean.py":762
* _break_prefer_re = re.compile(r'[^a-z]', re.I)
*
* def _insert_break(word, width, break_character): # <<<<<<<<<<<<<<
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_width)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_insert_break", 1, 3, 3, 1); __PYX_ERR(0, 754, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("_insert_break", 1, 3, 3, 1); __PYX_ERR(0, 762, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_break_character)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_insert_break", 1, 3, 3, 2); __PYX_ERR(0, 754, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("_insert_break", 1, 3, 3, 2); __PYX_ERR(0, 762, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_insert_break") < 0)) __PYX_ERR(0, 754, __pyx_L3_error)
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_insert_break") < 0)) __PYX_ERR(0, 762, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_insert_break", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 754, __pyx_L3_error)
+ __Pyx_RaiseArgtupleInvalid("_insert_break", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 762, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("lxml.html.clean._insert_break", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
__Pyx_RefNannySetupContext("_insert_break", 0);
__Pyx_INCREF(__pyx_v_word);
- /* "lxml/html/clean.py":755
+ /* "lxml/html/clean.py":763
*
* def _insert_break(word, width, break_character):
* orig_word = word # <<<<<<<<<<<<<<
__Pyx_INCREF(__pyx_v_word);
__pyx_v_orig_word = __pyx_v_word;
- /* "lxml/html/clean.py":756
+ /* "lxml/html/clean.py":764
* def _insert_break(word, width, break_character):
* orig_word = word
* result = '' # <<<<<<<<<<<<<<
__Pyx_INCREF(__pyx_kp_s__2);
__pyx_v_result = __pyx_kp_s__2;
- /* "lxml/html/clean.py":757
+ /* "lxml/html/clean.py":765
* orig_word = word
* result = ''
* while len(word) > width: # <<<<<<<<<<<<<<
* breaks = list(_break_prefer_re.finditer(start))
*/
while (1) {
- __pyx_t_1 = PyObject_Length(__pyx_v_word); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 757, __pyx_L1_error)
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 757, __pyx_L1_error)
+ __pyx_t_1 = PyObject_Length(__pyx_v_word); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 765, __pyx_L1_error)
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 765, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_v_width, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 757, __pyx_L1_error)
+ __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_v_width, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 765, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 757, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 765, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (!__pyx_t_4) break;
- /* "lxml/html/clean.py":758
+ /* "lxml/html/clean.py":766
* result = ''
* while len(word) > width:
* start = word[:width] # <<<<<<<<<<<<<<
* breaks = list(_break_prefer_re.finditer(start))
* if breaks:
*/
- __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_word, 0, 0, NULL, &__pyx_v_width, NULL, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 758, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_word, 0, 0, NULL, &__pyx_v_width, NULL, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 766, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_3);
__pyx_t_3 = 0;
- /* "lxml/html/clean.py":759
+ /* "lxml/html/clean.py":767
* while len(word) > width:
* start = word[:width]
* breaks = list(_break_prefer_re.finditer(start)) # <<<<<<<<<<<<<<
* if breaks:
* last_break = breaks[-1]
*/
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_break_prefer_re); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 759, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_break_prefer_re); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 767, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_finditer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 759, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_finditer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 767, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = NULL;
}
__pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_2, __pyx_v_start) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_start);
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 759, __pyx_L1_error)
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 767, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PySequence_List(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 759, __pyx_L1_error)
+ __pyx_t_5 = PySequence_List(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 767, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_XDECREF_SET(__pyx_v_breaks, ((PyObject*)__pyx_t_5));
__pyx_t_5 = 0;
- /* "lxml/html/clean.py":760
+ /* "lxml/html/clean.py":768
* start = word[:width]
* breaks = list(_break_prefer_re.finditer(start))
* if breaks: # <<<<<<<<<<<<<<
__pyx_t_4 = (PyList_GET_SIZE(__pyx_v_breaks) != 0);
if (__pyx_t_4) {
- /* "lxml/html/clean.py":761
+ /* "lxml/html/clean.py":769
* breaks = list(_break_prefer_re.finditer(start))
* if breaks:
* last_break = breaks[-1] # <<<<<<<<<<<<<<
* # Only walk back up to 10 characters to find a nice break:
* if last_break.end() > width-10:
*/
- __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_breaks, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 761, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_breaks, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 769, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_XDECREF_SET(__pyx_v_last_break, __pyx_t_5);
__pyx_t_5 = 0;
- /* "lxml/html/clean.py":763
+ /* "lxml/html/clean.py":771
* last_break = breaks[-1]
* # Only walk back up to 10 characters to find a nice break:
* if last_break.end() > width-10: # <<<<<<<<<<<<<<
* # FIXME: should the break character be at the end of the
* # chunk, or the beginning of the next chunk?
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_last_break, __pyx_n_s_end); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 763, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_last_break, __pyx_n_s_end); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 771, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_2 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 763, __pyx_L1_error)
+ if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 771, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_width, __pyx_int_10, 10, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 763, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_width, __pyx_int_10, 10, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 771, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 763, __pyx_L1_error)
+ __pyx_t_2 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 771, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 763, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 771, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_4) {
- /* "lxml/html/clean.py":766
+ /* "lxml/html/clean.py":774
* # FIXME: should the break character be at the end of the
* # chunk, or the beginning of the next chunk?
* start = word[:last_break.end()] # <<<<<<<<<<<<<<
* result += start + break_character
* word = word[len(start):]
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_last_break, __pyx_n_s_end); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 766, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_last_break, __pyx_n_s_end); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 774, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
}
__pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 766, __pyx_L1_error)
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 774, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_word, 0, 0, NULL, &__pyx_t_2, NULL, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 766, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_word, 0, 0, NULL, &__pyx_t_2, NULL, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 774, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF_SET(__pyx_v_start, __pyx_t_3);
__pyx_t_3 = 0;
- /* "lxml/html/clean.py":763
+ /* "lxml/html/clean.py":771
* last_break = breaks[-1]
* # Only walk back up to 10 characters to find a nice break:
* if last_break.end() > width-10: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":760
+ /* "lxml/html/clean.py":768
* start = word[:width]
* breaks = list(_break_prefer_re.finditer(start))
* if breaks: # <<<<<<<<<<<<<<
*/
}
- /* "lxml/html/clean.py":767
+ /* "lxml/html/clean.py":775
* # chunk, or the beginning of the next chunk?
* start = word[:last_break.end()]
* result += start + break_character # <<<<<<<<<<<<<<
* word = word[len(start):]
* result += word
*/
- __pyx_t_3 = PyNumber_Add(__pyx_v_start, __pyx_v_break_character); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 767, __pyx_L1_error)
+ __pyx_t_3 = PyNumber_Add(__pyx_v_start, __pyx_v_break_character); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 775, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 767, __pyx_L1_error)
+ __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 775, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF_SET(__pyx_v_result, __pyx_t_2);
__pyx_t_2 = 0;
- /* "lxml/html/clean.py":768
+ /* "lxml/html/clean.py":776
* start = word[:last_break.end()]
* result += start + break_character
* word = word[len(start):] # <<<<<<<<<<<<<<
* result += word
* return result
*/
- __pyx_t_1 = PyObject_Length(__pyx_v_start); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 768, __pyx_L1_error)
- __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_word, __pyx_t_1, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 768, __pyx_L1_error)
+ __pyx_t_1 = PyObject_Length(__pyx_v_start); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 776, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_word, __pyx_t_1, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 776, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF_SET(__pyx_v_word, __pyx_t_2);
__pyx_t_2 = 0;
}
- /* "lxml/html/clean.py":769
+ /* "lxml/html/clean.py":777
* result += start + break_character
* word = word[len(start):]
* result += word # <<<<<<<<<<<<<<
* return result
*
*/
- __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_v_word); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 769, __pyx_L1_error)
+ __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_v_word); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 777, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF_SET(__pyx_v_result, __pyx_t_2);
__pyx_t_2 = 0;
- /* "lxml/html/clean.py":770
+ /* "lxml/html/clean.py":778
* word = word[len(start):]
* result += word
* return result # <<<<<<<<<<<<<<
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "lxml/html/clean.py":754
+ /* "lxml/html/clean.py":762
* _break_prefer_re = re.compile(r'[^a-z]', re.I)
*
* def _insert_break(word, width, break_character): # <<<<<<<<<<<<<<
static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_kp_s_127_0_0_1, __pyx_k_127_0_0_1, sizeof(__pyx_k_127_0_0_1), 0, 0, 1, 0},
+ {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
{&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
{&__pyx_n_s_Cleaner, __pyx_k_Cleaner, sizeof(__pyx_k_Cleaner), 0, 0, 1, 1},
{&__pyx_n_s_Cleaner___call, __pyx_k_Cleaner___call, sizeof(__pyx_k_Cleaner___call), 0, 0, 1, 1},
{&__pyx_kp_s__15, __pyx_k__15, sizeof(__pyx_k__15), 0, 0, 1, 0},
{&__pyx_kp_s__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 0, 1, 0},
{&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0},
- {&__pyx_kp_s__41, __pyx_k__41, sizeof(__pyx_k__41), 0, 0, 1, 0},
+ {&__pyx_kp_s__42, __pyx_k__42, sizeof(__pyx_k__42), 0, 0, 1, 0},
{&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1},
{&__pyx_kp_s_a_z, __pyx_k_a_z, sizeof(__pyx_k_a_z), 0, 0, 1, 0},
+ {&__pyx_kp_s_a_zA_Z_son_a_zA_Z_s, __pyx_k_a_zA_Z_son_a_zA_Z_s, sizeof(__pyx_k_a_zA_Z_son_a_zA_Z_s), 0, 0, 1, 0},
{&__pyx_n_s_add_nofollow, __pyx_k_add_nofollow, sizeof(__pyx_k_add_nofollow), 0, 0, 1, 1},
{&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
{&__pyx_n_s_allow_element, __pyx_k_allow_element, sizeof(__pyx_k_allow_element), 0, 0, 1, 1},
{&__pyx_n_s_condition, __pyx_k_condition, sizeof(__pyx_k_condition), 0, 0, 1, 1},
{&__pyx_n_s_conditional_comment_re, __pyx_k_conditional_comment_re, sizeof(__pyx_k_conditional_comment_re), 0, 0, 1, 1},
{&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
- {&__pyx_n_s_css_import_re, __pyx_k_css_import_re, sizeof(__pyx_k_css_import_re), 0, 0, 1, 1},
- {&__pyx_n_s_css_javascript_re, __pyx_k_css_javascript_re, sizeof(__pyx_k_css_javascript_re), 0, 0, 1, 1},
{&__pyx_kp_s_data_image_base64, __pyx_k_data_image_base64, sizeof(__pyx_k_data_image_base64), 0, 0, 1, 0},
{&__pyx_n_s_deepcopy, __pyx_k_deepcopy, sizeof(__pyx_k_deepcopy), 0, 0, 1, 1},
{&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1},
{&__pyx_n_s_link_text, __pyx_k_link_text, sizeof(__pyx_k_link_text), 0, 0, 1, 1},
{&__pyx_n_s_links, __pyx_k_links, sizeof(__pyx_k_links), 0, 0, 1, 1},
{&__pyx_kp_s_localhost, __pyx_k_localhost, sizeof(__pyx_k_localhost), 0, 0, 1, 0},
+ {&__pyx_n_s_looks_like_tag_content, __pyx_k_looks_like_tag_content, sizeof(__pyx_k_looks_like_tag_content), 0, 0, 1, 1},
{&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1},
{&__pyx_n_s_lxml, __pyx_k_lxml, sizeof(__pyx_k_lxml), 0, 0, 1, 1},
{&__pyx_n_s_lxml_html, __pyx_k_lxml_html, sizeof(__pyx_k_lxml_html), 0, 0, 1, 1},
{&__pyx_n_s_remove_tags, __pyx_k_remove_tags, sizeof(__pyx_k_remove_tags), 0, 0, 1, 1},
{&__pyx_n_s_remove_unknown_tags, __pyx_k_remove_unknown_tags, sizeof(__pyx_k_remove_unknown_tags), 0, 0, 1, 1},
{&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1},
+ {&__pyx_n_s_replace_css_import, __pyx_k_replace_css_import, sizeof(__pyx_k_replace_css_import), 0, 0, 1, 1},
+ {&__pyx_n_s_replace_css_javascript, __pyx_k_replace_css_javascript, sizeof(__pyx_k_replace_css_javascript), 0, 0, 1, 1},
{&__pyx_n_s_replacement, __pyx_k_replacement, sizeof(__pyx_k_replacement), 0, 0, 1, 1},
{&__pyx_n_s_resolve_base_href, __pyx_k_resolve_base_href, sizeof(__pyx_k_resolve_base_href), 0, 0, 1, 1},
{&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1},
{&__pyx_n_s_sub, __pyx_k_sub, sizeof(__pyx_k_sub), 0, 0, 1, 1},
{&__pyx_n_s_substitute_comments, __pyx_k_substitute_comments, sizeof(__pyx_k_substitute_comments), 0, 0, 1, 1},
{&__pyx_n_s_substitute_whitespace, __pyx_k_substitute_whitespace, sizeof(__pyx_k_substitute_whitespace), 0, 0, 1, 1},
+ {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
{&__pyx_n_s_tag, __pyx_k_tag, sizeof(__pyx_k_tag), 0, 0, 1, 1},
{&__pyx_n_s_tag_link_attrs, __pyx_k_tag_link_attrs, sizeof(__pyx_k_tag_link_attrs), 0, 0, 1, 1},
{&__pyx_n_s_tags, __pyx_k_tags, sizeof(__pyx_k_tags), 0, 0, 1, 1},
{&__pyx_n_s_urlparse, __pyx_k_urlparse, sizeof(__pyx_k_urlparse), 0, 0, 1, 1},
{&__pyx_n_s_urlsplit, __pyx_k_urlsplit, sizeof(__pyx_k_urlsplit), 0, 0, 1, 1},
{&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
+ {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1},
{&__pyx_n_s_whitelist_tags, __pyx_k_whitelist_tags, sizeof(__pyx_k_whitelist_tags), 0, 0, 1, 1},
{&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1},
{&__pyx_n_s_word, __pyx_k_word, sizeof(__pyx_k_word), 0, 0, 1, 1},
{0, 0, 0, 0, 0, 0, 0}
};
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
- __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 16, __pyx_L1_error)
- __pyx_builtin_NameError = __Pyx_GetBuiltinName(__pyx_n_s_NameError); if (!__pyx_builtin_NameError) __PYX_ERR(0, 26, __pyx_L1_error)
- __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) __PYX_ERR(0, 28, __pyx_L1_error)
- __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 99, __pyx_L1_error)
- __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 223, __pyx_L1_error)
- __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 231, __pyx_L1_error)
- __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 263, __pyx_L1_error)
+ __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 17, __pyx_L1_error)
+ __pyx_builtin_NameError = __Pyx_GetBuiltinName(__pyx_n_s_NameError); if (!__pyx_builtin_NameError) __PYX_ERR(0, 27, __pyx_L1_error)
+ __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) __PYX_ERR(0, 29, __pyx_L1_error)
+ __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 104, __pyx_L1_error)
+ __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 228, __pyx_L1_error)
+ __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 236, __pyx_L1_error)
+ __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 268, __pyx_L1_error)
return 0;
__pyx_L1_error:;
return -1;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
- /* "lxml/html/clean.py":231
+ /* "lxml/html/clean.py":236
* if kw.get("allow_tags"):
* if kw.get("remove_unknown_tags"):
* raise ValueError("It does not make sense to pass in both " # <<<<<<<<<<<<<<
* "allow_tags and remove_unknown_tags")
* self.remove_unknown_tags = False
*/
- __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_It_does_not_make_sense_to_pass_i); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 231, __pyx_L1_error)
+ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_It_does_not_make_sense_to_pass_i); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 236, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple_);
__Pyx_GIVEREF(__pyx_tuple_);
- /* "lxml/html/clean.py":316
+ /* "lxml/html/clean.py":321
* if not self.style:
* for el in list(doc.iter('style')):
* if el.get('type', '').lower().strip() == 'text/javascript': # <<<<<<<<<<<<<<
* el.drop_tree()
* continue
*/
- __pyx_tuple__3 = PyTuple_Pack(2, __pyx_n_s_type, __pyx_kp_s__2); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 316, __pyx_L1_error)
+ __pyx_tuple__3 = PyTuple_Pack(2, __pyx_n_s_type, __pyx_kp_s__2); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 321, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__3);
__Pyx_GIVEREF(__pyx_tuple__3);
- /* "lxml/html/clean.py":342
+ /* "lxml/html/clean.py":347
* # allowed, as you can put Javascript in them
* for el in list(doc.iter('link')):
* if 'stylesheet' in el.get('rel', '').lower(): # <<<<<<<<<<<<<<
* # Note this kills alternate stylesheets as well
* if not self.allow_element(el):
*/
- __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_s_rel, __pyx_kp_s__2); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 342, __pyx_L1_error)
+ __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_s_rel, __pyx_kp_s__2); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 347, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__4);
__Pyx_GIVEREF(__pyx_tuple__4);
- /* "lxml/html/clean.py":349
+ /* "lxml/html/clean.py":354
* kill_tags.add('meta')
* if self.page_structure:
* remove_tags.update(('head', 'html', 'title')) # <<<<<<<<<<<<<<
* if self.embedded:
* # FIXME: is <layer> really embedded?
*/
- __pyx_tuple__5 = PyTuple_Pack(3, __pyx_n_s_head, __pyx_n_s_html, __pyx_n_s_title); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 349, __pyx_L1_error)
+ __pyx_tuple__5 = PyTuple_Pack(3, __pyx_n_s_head, __pyx_n_s_html, __pyx_n_s_title); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 354, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__5);
__Pyx_GIVEREF(__pyx_tuple__5);
- /* "lxml/html/clean.py":360
+ /* "lxml/html/clean.py":365
* if parent is None:
* el.drop_tree()
* kill_tags.update(('applet',)) # <<<<<<<<<<<<<<
* # The alternate contents that are in an iframe are a good fallback:
* remove_tags.update(('iframe', 'embed', 'layer', 'object', 'param'))
*/
- __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_applet); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 360, __pyx_L1_error)
+ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_applet); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 365, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__6);
__Pyx_GIVEREF(__pyx_tuple__6);
- /* "lxml/html/clean.py":362
+ /* "lxml/html/clean.py":367
* kill_tags.update(('applet',))
* # The alternate contents that are in an iframe are a good fallback:
* remove_tags.update(('iframe', 'embed', 'layer', 'object', 'param')) # <<<<<<<<<<<<<<
* if self.frames:
* # FIXME: ideally we should look at the frame links, but
*/
- __pyx_tuple__7 = PyTuple_Pack(5, __pyx_n_s_iframe, __pyx_n_s_embed, __pyx_n_s_layer, __pyx_n_s_object, __pyx_n_s_param); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 362, __pyx_L1_error)
+ __pyx_tuple__7 = PyTuple_Pack(5, __pyx_n_s_iframe, __pyx_n_s_embed, __pyx_n_s_layer, __pyx_n_s_object, __pyx_n_s_param); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 367, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__7);
__Pyx_GIVEREF(__pyx_tuple__7);
- /* "lxml/html/clean.py":370
+ /* "lxml/html/clean.py":375
* if self.forms:
* remove_tags.add('form')
* kill_tags.update(('button', 'input', 'select', 'textarea')) # <<<<<<<<<<<<<<
* if self.annoying_tags:
* remove_tags.update(('blink', 'marquee'))
*/
- __pyx_tuple__8 = PyTuple_Pack(4, __pyx_n_s_button, __pyx_n_s_input, __pyx_n_s_select, __pyx_n_s_textarea); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 370, __pyx_L1_error)
+ __pyx_tuple__8 = PyTuple_Pack(4, __pyx_n_s_button, __pyx_n_s_input, __pyx_n_s_select, __pyx_n_s_textarea); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 375, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__8);
__Pyx_GIVEREF(__pyx_tuple__8);
- /* "lxml/html/clean.py":372
+ /* "lxml/html/clean.py":377
* kill_tags.update(('button', 'input', 'select', 'textarea'))
* if self.annoying_tags:
* remove_tags.update(('blink', 'marquee')) # <<<<<<<<<<<<<<
*
* _remove = []
*/
- __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_s_blink, __pyx_n_s_marquee); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 372, __pyx_L1_error)
+ __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_s_blink, __pyx_n_s_marquee); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 377, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__9);
__Pyx_GIVEREF(__pyx_tuple__9);
- /* "lxml/html/clean.py":484
+ /* "lxml/html/clean.py":489
* return False
* scheme, netloc, path, query, fragment = urlsplit(url)
* netloc = netloc.lower().split(':', 1)[0] # <<<<<<<<<<<<<<
* if scheme not in ('http', 'https'):
* return False
*/
- __pyx_tuple__11 = PyTuple_Pack(2, __pyx_kp_s__10, __pyx_int_1); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 484, __pyx_L1_error)
+ __pyx_tuple__11 = PyTuple_Pack(2, __pyx_kp_s__10, __pyx_int_1); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 489, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__11);
__Pyx_GIVEREF(__pyx_tuple__11);
- /* "lxml/html/clean.py":532
+ /* "lxml/html/clean.py":537
* """
* style = self._substitute_comments('', style)
* style = style.replace('\\', '') # <<<<<<<<<<<<<<
* style = _substitute_whitespace('', style)
* style = style.lower()
*/
- __pyx_tuple__13 = PyTuple_Pack(2, __pyx_kp_s__12, __pyx_kp_s__2); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 532, __pyx_L1_error)
+ __pyx_tuple__13 = PyTuple_Pack(2, __pyx_kp_s__12, __pyx_kp_s__2); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 537, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__13);
__Pyx_GIVEREF(__pyx_tuple__13);
- /* "lxml/html/clean.py":619
+ /* "lxml/html/clean.py":627
* if pre_children:
* el.text = text
* el[:0] = pre_children # <<<<<<<<<<<<<<
*
* def _link_text(text, link_regexes, avoid_hosts, factory):
*/
- __pyx_slice__14 = PySlice_New(Py_None, __pyx_int_0, Py_None); if (unlikely(!__pyx_slice__14)) __PYX_ERR(0, 619, __pyx_L1_error)
+ __pyx_slice__14 = PySlice_New(Py_None, __pyx_int_0, Py_None); if (unlikely(!__pyx_slice__14)) __PYX_ERR(0, 627, __pyx_L1_error)
__Pyx_GOTREF(__pyx_slice__14);
__Pyx_GIVEREF(__pyx_slice__14);
- /* "lxml/html/clean.py":659
+ /* "lxml/html/clean.py":667
* # These punctuation marks shouldn't end a link
* end -= 1
* link = link[:-1] # <<<<<<<<<<<<<<
* prev_text = text[:best_match.start()]
* if links:
*/
- __pyx_slice__17 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__17)) __PYX_ERR(0, 659, __pyx_L1_error)
+ __pyx_slice__17 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__17)) __PYX_ERR(0, 667, __pyx_L1_error)
__Pyx_GOTREF(__pyx_slice__17);
__Pyx_GIVEREF(__pyx_slice__17);
- /* "lxml/html/clean.py":78
+ /* "lxml/html/clean.py":72
+ * r'@\s*import', re.I).sub
+ *
+ * _looks_like_tag_content = re.compile( # <<<<<<<<<<<<<<
+ * r'</?[a-zA-Z]+|\son[a-zA-Z]+\s*=',
+ * *((re.ASCII,) if sys.version_info[0] >= 3 else ())).search
+ */
+ __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_a_zA_Z_son_a_zA_Z_s); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 72, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__18);
+ __Pyx_GIVEREF(__pyx_tuple__18);
+
+ /* "lxml/html/clean.py":83
* r'(?:javascript|jscript|livescript|vbscript|data|about|mocha):',
* re.I).search
* def _is_javascript_scheme(s): # <<<<<<<<<<<<<<
* if _is_image_dataurl(s):
* return None
*/
- __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_s_2); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 78, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__18);
- __Pyx_GIVEREF(__pyx_tuple__18);
- __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_is_javascript_scheme, 78, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 78, __pyx_L1_error)
+ __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_s_2); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 83, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__19);
+ __Pyx_GIVEREF(__pyx_tuple__19);
+ __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_is_javascript_scheme, 83, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 83, __pyx_L1_error)
- /* "lxml/html/clean.py":83
+ /* "lxml/html/clean.py":88
* return _is_possibly_malicious_scheme(s)
*
* _substitute_whitespace = re.compile(r'[\s\x00-\x08\x0B\x0C\x0E-\x19]+').sub # <<<<<<<<<<<<<<
* # FIXME: should data: be blocked?
*
*/
- __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_s_x00_x08_x0B_x0C_x0E_x19); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 83, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__20);
- __Pyx_GIVEREF(__pyx_tuple__20);
+ __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_s_x00_x08_x0B_x0C_x0E_x19); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 88, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__21);
+ __Pyx_GIVEREF(__pyx_tuple__21);
- /* "lxml/html/clean.py":90
+ /* "lxml/html/clean.py":95
* r'\[if[\s\n\r]+.*?][\s\n\r]*>', re.I|re.S)
*
* _find_styled_elements = etree.XPath( # <<<<<<<<<<<<<<
* "descendant-or-self::*[@style]")
*
*/
- __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_descendant_or_self_style); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 90, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__21);
- __Pyx_GIVEREF(__pyx_tuple__21);
+ __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_descendant_or_self_style); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 95, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__22);
+ __Pyx_GIVEREF(__pyx_tuple__22);
- /* "lxml/html/clean.py":93
+ /* "lxml/html/clean.py":98
* "descendant-or-self::*[@style]")
*
* _find_external_links = etree.XPath( # <<<<<<<<<<<<<<
* ("descendant-or-self::a [normalize-space(@href) and substring(normalize-space(@href),1,1) != '#'] |"
* "descendant-or-self::x:a[normalize-space(@href) and substring(normalize-space(@href),1,1) != '#']"),
*/
- __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_descendant_or_self_a_normalize_s); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 93, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__22);
- __Pyx_GIVEREF(__pyx_tuple__22);
+ __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_descendant_or_self_a_normalize_s); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 98, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__23);
+ __Pyx_GIVEREF(__pyx_tuple__23);
- /* "lxml/html/clean.py":99
+ /* "lxml/html/clean.py":104
*
*
* class Cleaner(object): # <<<<<<<<<<<<<<
* """
* Instances cleans the document of each of the possible offending
*/
- __pyx_tuple__23 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 99, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__23);
- __Pyx_GIVEREF(__pyx_tuple__23);
+ __pyx_tuple__24 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 104, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__24);
+ __Pyx_GIVEREF(__pyx_tuple__24);
- /* "lxml/html/clean.py":217
+ /* "lxml/html/clean.py":222
* whitelist_tags = {'iframe', 'embed'}
*
* def __init__(self, **kw): # <<<<<<<<<<<<<<
* not_an_attribute = object()
* for name, value in kw.items():
*/
- __pyx_tuple__24 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_kw, __pyx_n_s_not_an_attribute, __pyx_n_s_name_2, __pyx_n_s_value, __pyx_n_s_default); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 217, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__24);
- __Pyx_GIVEREF(__pyx_tuple__24);
- __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_init, 217, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 217, __pyx_L1_error)
+ __pyx_tuple__25 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_kw, __pyx_n_s_not_an_attribute, __pyx_n_s_name_2, __pyx_n_s_value, __pyx_n_s_default); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 222, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__25);
+ __Pyx_GIVEREF(__pyx_tuple__25);
+ __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_init, 222, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 222, __pyx_L1_error)
- /* "lxml/html/clean.py":257
+ /* "lxml/html/clean.py":262
* )
*
* def __call__(self, doc): # <<<<<<<<<<<<<<
* """
* Cleans the document.
*/
- __pyx_tuple__26 = PyTuple_Pack(17, __pyx_n_s_self, __pyx_n_s_doc, __pyx_n_s_getroot, __pyx_n_s_el, __pyx_n_s_kill_tags, __pyx_n_s_remove_tags, __pyx_n_s_allow_tags, __pyx_n_s_safe_attrs, __pyx_n_s_attrib, __pyx_n_s_aname, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_parent, __pyx_n_s_remove, __pyx_n_s_kill, __pyx_n_s_bad, __pyx_n_s_rel); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 257, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__26);
- __Pyx_GIVEREF(__pyx_tuple__26);
- __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(2, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_call, 257, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 257, __pyx_L1_error)
+ __pyx_tuple__27 = PyTuple_Pack(17, __pyx_n_s_self, __pyx_n_s_doc, __pyx_n_s_getroot, __pyx_n_s_el, __pyx_n_s_kill_tags, __pyx_n_s_remove_tags, __pyx_n_s_allow_tags, __pyx_n_s_safe_attrs, __pyx_n_s_attrib, __pyx_n_s_aname, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_parent, __pyx_n_s_remove, __pyx_n_s_kill, __pyx_n_s_bad, __pyx_n_s_rel); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 262, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__27);
+ __Pyx_GIVEREF(__pyx_tuple__27);
+ __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(2, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_call, 262, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 262, __pyx_L1_error)
- /* "lxml/html/clean.py":442
+ /* "lxml/html/clean.py":447
* el.set('rel', rel)
*
* def allow_follow(self, anchor): # <<<<<<<<<<<<<<
* """
* Override to suppress rel="nofollow" on some anchors.
*/
- __pyx_tuple__28 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_anchor); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 442, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__28);
- __Pyx_GIVEREF(__pyx_tuple__28);
- __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_allow_follow, 442, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 442, __pyx_L1_error)
+ __pyx_tuple__29 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_anchor); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 447, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__29);
+ __Pyx_GIVEREF(__pyx_tuple__29);
+ __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_allow_follow, 447, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 447, __pyx_L1_error)
- /* "lxml/html/clean.py":448
+ /* "lxml/html/clean.py":453
* return False
*
* def allow_element(self, el): # <<<<<<<<<<<<<<
* """
* Decide whether an element is configured to be accepted or rejected.
*/
- __pyx_tuple__30 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_el, __pyx_n_s_attr, __pyx_n_s_one_attr, __pyx_n_s_url); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 448, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__30);
- __Pyx_GIVEREF(__pyx_tuple__30);
- __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_allow_element, 448, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 448, __pyx_L1_error)
+ __pyx_tuple__31 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_el, __pyx_n_s_attr, __pyx_n_s_one_attr, __pyx_n_s_url); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 453, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__31);
+ __Pyx_GIVEREF(__pyx_tuple__31);
+ __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_allow_element, 453, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 453, __pyx_L1_error)
- /* "lxml/html/clean.py":472
+ /* "lxml/html/clean.py":477
* return self.allow_embedded_url(el, url)
*
* def allow_embedded_url(self, el, url): # <<<<<<<<<<<<<<
* """
* Decide whether a URL that was found in an element's attributes or text
*/
- __pyx_tuple__32 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_el, __pyx_n_s_url, __pyx_n_s_scheme, __pyx_n_s_netloc, __pyx_n_s_path, __pyx_n_s_query, __pyx_n_s_fragment); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 472, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__32);
- __Pyx_GIVEREF(__pyx_tuple__32);
- __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_allow_embedded_url, 472, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 472, __pyx_L1_error)
+ __pyx_tuple__33 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_el, __pyx_n_s_url, __pyx_n_s_scheme, __pyx_n_s_netloc, __pyx_n_s_path, __pyx_n_s_query, __pyx_n_s_fragment); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 477, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__33);
+ __Pyx_GIVEREF(__pyx_tuple__33);
+ __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_allow_embedded_url, 477, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 477, __pyx_L1_error)
- /* "lxml/html/clean.py":491
+ /* "lxml/html/clean.py":496
* return False
*
* def kill_conditional_comments(self, doc): # <<<<<<<<<<<<<<
* """
* IE conditional comments basically embed HTML that the parser
*/
- __pyx_tuple__34 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_doc, __pyx_n_s_has_conditional_comment); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 491, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__34);
- __Pyx_GIVEREF(__pyx_tuple__34);
- __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_kill_conditional_comments, 491, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 491, __pyx_L1_error)
+ __pyx_tuple__35 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_doc, __pyx_n_s_has_conditional_comment); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 496, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__35);
+ __Pyx_GIVEREF(__pyx_tuple__35);
+ __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_kill_conditional_comments, 496, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 496, __pyx_L1_error)
- /* "lxml/html/clean.py":502
+ /* "lxml/html/clean.py":507
* etree.Comment)
*
* def _kill_elements(self, doc, condition, iterate=None): # <<<<<<<<<<<<<<
* bad = []
* for el in doc.iter(iterate):
*/
- __pyx_tuple__36 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_doc, __pyx_n_s_condition, __pyx_n_s_iterate, __pyx_n_s_bad, __pyx_n_s_el); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 502, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__36);
- __Pyx_GIVEREF(__pyx_tuple__36);
- __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_kill_elements, 502, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 502, __pyx_L1_error)
- __pyx_tuple__38 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 502, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__38);
- __Pyx_GIVEREF(__pyx_tuple__38);
+ __pyx_tuple__37 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_doc, __pyx_n_s_condition, __pyx_n_s_iterate, __pyx_n_s_bad, __pyx_n_s_el); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 507, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__37);
+ __Pyx_GIVEREF(__pyx_tuple__37);
+ __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_kill_elements, 507, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 507, __pyx_L1_error)
+ __pyx_tuple__39 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 507, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__39);
+ __Pyx_GIVEREF(__pyx_tuple__39);
- /* "lxml/html/clean.py":510
+ /* "lxml/html/clean.py":515
* el.drop_tree()
*
* def _remove_javascript_link(self, link): # <<<<<<<<<<<<<<
* # links like "j a v a s c r i p t:" might be interpreted in IE
* new = _substitute_whitespace('', unquote_plus(link))
*/
- __pyx_tuple__39 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_link, __pyx_n_s_new); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 510, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__39);
- __Pyx_GIVEREF(__pyx_tuple__39);
- __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_remove_javascript_link, 510, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 510, __pyx_L1_error)
+ __pyx_tuple__40 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_link, __pyx_n_s_new); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 515, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__40);
+ __Pyx_GIVEREF(__pyx_tuple__40);
+ __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_remove_javascript_link, 515, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 515, __pyx_L1_error)
- /* "lxml/html/clean.py":520
+ /* "lxml/html/clean.py":525
* _substitute_comments = re.compile(r'/\*.*?\*[inserted by cython to avoid comment closer]/', re.S).sub
*
* def _has_sneaky_javascript(self, style): # <<<<<<<<<<<<<<
* """
* Depending on the browser, stuff like ``e x p r e s s i o n(...)``
*/
- __pyx_tuple__42 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_style); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 520, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__42);
- __Pyx_GIVEREF(__pyx_tuple__42);
- __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_has_sneaky_javascript, 520, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 520, __pyx_L1_error)
+ __pyx_tuple__43 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_style); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 525, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__43);
+ __Pyx_GIVEREF(__pyx_tuple__43);
+ __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_has_sneaky_javascript, 525, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 525, __pyx_L1_error)
- /* "lxml/html/clean.py":544
+ /* "lxml/html/clean.py":552
* return False
*
* def clean_html(self, html): # <<<<<<<<<<<<<<
* result_type = type(html)
* if isinstance(html, basestring):
*/
- __pyx_tuple__44 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_html, __pyx_n_s_result_type, __pyx_n_s_doc); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 544, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__44);
- __Pyx_GIVEREF(__pyx_tuple__44);
- __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_clean_html, 544, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 544, __pyx_L1_error)
+ __pyx_tuple__45 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_html, __pyx_n_s_result_type, __pyx_n_s_doc); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 552, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__45);
+ __Pyx_GIVEREF(__pyx_tuple__45);
+ __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_clean_html, 552, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 552, __pyx_L1_error)
- /* "lxml/html/clean.py":571
+ /* "lxml/html/clean.py":579
* re.compile(r'^localhost', re.I),
* re.compile(r'\bexample\.(?:com|org|net)$', re.I),
* re.compile(r'^127\.0\.0\.1$'), # <<<<<<<<<<<<<<
* ]
*
*/
- __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_127_0_0_1); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 571, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__46);
- __Pyx_GIVEREF(__pyx_tuple__46);
+ __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_127_0_0_1); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 579, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__47);
+ __Pyx_GIVEREF(__pyx_tuple__47);
- /* "lxml/html/clean.py":576
+ /* "lxml/html/clean.py":584
* _avoid_classes = ['nolink']
*
* def autolink(el, link_regexes=_link_regexes, # <<<<<<<<<<<<<<
* avoid_elements=_avoid_elements,
* avoid_hosts=_avoid_hosts,
*/
- __pyx_tuple__47 = PyTuple_Pack(12, __pyx_n_s_el, __pyx_n_s_link_regexes, __pyx_n_s_avoid_elements, __pyx_n_s_avoid_hosts, __pyx_n_s_avoid_classes, __pyx_n_s_class_name, __pyx_n_s_match_class, __pyx_n_s_child, __pyx_n_s_text, __pyx_n_s_tail_children, __pyx_n_s_index, __pyx_n_s_pre_children); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 576, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__47);
- __Pyx_GIVEREF(__pyx_tuple__47);
- __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(5, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_autolink, 576, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 576, __pyx_L1_error)
+ __pyx_tuple__48 = PyTuple_Pack(12, __pyx_n_s_el, __pyx_n_s_link_regexes, __pyx_n_s_avoid_elements, __pyx_n_s_avoid_hosts, __pyx_n_s_avoid_classes, __pyx_n_s_class_name, __pyx_n_s_match_class, __pyx_n_s_child, __pyx_n_s_text, __pyx_n_s_tail_children, __pyx_n_s_index, __pyx_n_s_pre_children); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 584, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__48);
+ __Pyx_GIVEREF(__pyx_tuple__48);
+ __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(5, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_autolink, 584, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 584, __pyx_L1_error)
- /* "lxml/html/clean.py":621
+ /* "lxml/html/clean.py":629
* el[:0] = pre_children
*
* def _link_text(text, link_regexes, avoid_hosts, factory): # <<<<<<<<<<<<<<
* leading_text = ''
* links = []
*/
- __pyx_tuple__49 = PyTuple_Pack(19, __pyx_n_s_text, __pyx_n_s_link_regexes, __pyx_n_s_avoid_hosts, __pyx_n_s_factory, __pyx_n_s_leading_text, __pyx_n_s_links, __pyx_n_s_last_pos, __pyx_n_s_best_match, __pyx_n_s_best_pos, __pyx_n_s_regex, __pyx_n_s_regex_pos, __pyx_n_s_match, __pyx_n_s_host, __pyx_n_s_host_regex, __pyx_n_s_link, __pyx_n_s_end, __pyx_n_s_prev_text, __pyx_n_s_anchor, __pyx_n_s_body); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 621, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__49);
- __Pyx_GIVEREF(__pyx_tuple__49);
- __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_link_text, 621, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 621, __pyx_L1_error)
+ __pyx_tuple__50 = PyTuple_Pack(19, __pyx_n_s_text, __pyx_n_s_link_regexes, __pyx_n_s_avoid_hosts, __pyx_n_s_factory, __pyx_n_s_leading_text, __pyx_n_s_links, __pyx_n_s_last_pos, __pyx_n_s_best_match, __pyx_n_s_best_pos, __pyx_n_s_regex, __pyx_n_s_regex_pos, __pyx_n_s_match, __pyx_n_s_host, __pyx_n_s_host_regex, __pyx_n_s_link, __pyx_n_s_end, __pyx_n_s_prev_text, __pyx_n_s_anchor, __pyx_n_s_body); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 629, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__50);
+ __Pyx_GIVEREF(__pyx_tuple__50);
+ __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_link_text, 629, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 629, __pyx_L1_error)
- /* "lxml/html/clean.py":679
+ /* "lxml/html/clean.py":687
* return leading_text, links
*
* def autolink_html(html, *args, **kw): # <<<<<<<<<<<<<<
* result_type = type(html)
* if isinstance(html, basestring):
*/
- __pyx_tuple__51 = PyTuple_Pack(5, __pyx_n_s_html, __pyx_n_s_args, __pyx_n_s_kw, __pyx_n_s_result_type, __pyx_n_s_doc); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 679, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__51);
- __Pyx_GIVEREF(__pyx_tuple__51);
- __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_autolink_html, 679, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 679, __pyx_L1_error)
+ __pyx_tuple__52 = PyTuple_Pack(5, __pyx_n_s_html, __pyx_n_s_args, __pyx_n_s_kw, __pyx_n_s_result_type, __pyx_n_s_doc); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 687, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__52);
+ __Pyx_GIVEREF(__pyx_tuple__52);
+ __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_autolink_html, 687, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 687, __pyx_L1_error)
- /* "lxml/html/clean.py":697
+ /* "lxml/html/clean.py":705
* _avoid_word_break_classes = ['nobreak']
*
* def word_break(el, max_width=40, # <<<<<<<<<<<<<<
* avoid_elements=_avoid_word_break_elements,
* avoid_classes=_avoid_word_break_classes,
*/
- __pyx_tuple__53 = PyTuple_Pack(9, __pyx_n_s_el, __pyx_n_s_max_width, __pyx_n_s_avoid_elements, __pyx_n_s_avoid_classes, __pyx_n_s_break_character, __pyx_n_s_class_name, __pyx_n_s_dont_break, __pyx_n_s_avoid, __pyx_n_s_child); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 697, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__53);
- __Pyx_GIVEREF(__pyx_tuple__53);
- __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(5, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_word_break, 697, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 697, __pyx_L1_error)
+ __pyx_tuple__54 = PyTuple_Pack(9, __pyx_n_s_el, __pyx_n_s_max_width, __pyx_n_s_avoid_elements, __pyx_n_s_avoid_classes, __pyx_n_s_break_character, __pyx_n_s_class_name, __pyx_n_s_dont_break, __pyx_n_s_avoid, __pyx_n_s_child); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 705, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__54);
+ __Pyx_GIVEREF(__pyx_tuple__54);
+ __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(5, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_word_break, 705, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 705, __pyx_L1_error)
- /* "lxml/html/clean.py":700
+ /* "lxml/html/clean.py":708
* avoid_elements=_avoid_word_break_elements,
* avoid_classes=_avoid_word_break_classes,
* break_character=unichr(0x200b)): # <<<<<<<<<<<<<<
* """
* Breaks any long words found in the body of the text (not attributes).
*/
- __pyx_tuple__55 = PyTuple_Pack(1, __pyx_int_8203); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 700, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__55);
- __Pyx_GIVEREF(__pyx_tuple__55);
+ __pyx_tuple__56 = PyTuple_Pack(1, __pyx_int_8203); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 708, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__56);
+ __Pyx_GIVEREF(__pyx_tuple__56);
- /* "lxml/html/clean.py":738
+ /* "lxml/html/clean.py":746
* child.tail = _break_text(child.tail, max_width, break_character)
*
* def word_break_html(html, *args, **kw): # <<<<<<<<<<<<<<
* result_type = type(html)
* doc = fromstring(html)
*/
- __pyx_tuple__56 = PyTuple_Pack(5, __pyx_n_s_html, __pyx_n_s_args, __pyx_n_s_kw, __pyx_n_s_result_type, __pyx_n_s_doc); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 738, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__56);
- __Pyx_GIVEREF(__pyx_tuple__56);
- __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_word_break_html, 738, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 738, __pyx_L1_error)
+ __pyx_tuple__57 = PyTuple_Pack(5, __pyx_n_s_html, __pyx_n_s_args, __pyx_n_s_kw, __pyx_n_s_result_type, __pyx_n_s_doc); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 746, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__57);
+ __Pyx_GIVEREF(__pyx_tuple__57);
+ __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_word_break_html, 746, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 746, __pyx_L1_error)
- /* "lxml/html/clean.py":744
+ /* "lxml/html/clean.py":752
* return _transform_result(result_type, doc)
*
* def _break_text(text, max_width, break_character): # <<<<<<<<<<<<<<
* words = text.split()
* for word in words:
*/
- __pyx_tuple__58 = PyTuple_Pack(6, __pyx_n_s_text, __pyx_n_s_max_width, __pyx_n_s_break_character, __pyx_n_s_words, __pyx_n_s_word, __pyx_n_s_replacement); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 744, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__58);
- __Pyx_GIVEREF(__pyx_tuple__58);
- __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_break_text, 744, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 744, __pyx_L1_error)
+ __pyx_tuple__59 = PyTuple_Pack(6, __pyx_n_s_text, __pyx_n_s_max_width, __pyx_n_s_break_character, __pyx_n_s_words, __pyx_n_s_word, __pyx_n_s_replacement); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 752, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__59);
+ __Pyx_GIVEREF(__pyx_tuple__59);
+ __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_break_text, 752, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 752, __pyx_L1_error)
- /* "lxml/html/clean.py":754
+ /* "lxml/html/clean.py":762
* _break_prefer_re = re.compile(r'[^a-z]', re.I)
*
* def _insert_break(word, width, break_character): # <<<<<<<<<<<<<<
* orig_word = word
* result = ''
*/
- __pyx_tuple__60 = PyTuple_Pack(8, __pyx_n_s_word, __pyx_n_s_width, __pyx_n_s_break_character, __pyx_n_s_orig_word, __pyx_n_s_result, __pyx_n_s_start, __pyx_n_s_breaks, __pyx_n_s_last_break); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 754, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__60);
- __Pyx_GIVEREF(__pyx_tuple__60);
- __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_insert_break, 754, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 754, __pyx_L1_error)
+ __pyx_tuple__61 = PyTuple_Pack(8, __pyx_n_s_word, __pyx_n_s_width, __pyx_n_s_break_character, __pyx_n_s_orig_word, __pyx_n_s_result, __pyx_n_s_start, __pyx_n_s_breaks, __pyx_n_s_last_break); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 762, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__61);
+ __Pyx_GIVEREF(__pyx_tuple__61);
+ __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_insert_break, 762, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 762, __pyx_L1_error)
__Pyx_RefNannyFinishContext();
return 0;
__pyx_L1_error:;
if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
__pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
__pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
__pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error)
__pyx_int_40 = PyInt_FromLong(40); if (unlikely(!__pyx_int_40)) __PYX_ERR(0, 1, __pyx_L1_error)
__pyx_int_8203 = PyInt_FromLong(8203); if (unlikely(!__pyx_int_8203)) __PYX_ERR(0, 1, __pyx_L1_error)
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
/*--- Type init code ---*/
- if (PyType_Ready(&__pyx_type_4lxml_4html_5clean___pyx_scope_struct__kill_conditional_comments) < 0) __PYX_ERR(0, 491, __pyx_L1_error)
+ if (PyType_Ready(&__pyx_type_4lxml_4html_5clean___pyx_scope_struct__kill_conditional_comments) < 0) __PYX_ERR(0, 496, __pyx_L1_error)
#if PY_VERSION_HEX < 0x030800B1
__pyx_type_4lxml_4html_5clean___pyx_scope_struct__kill_conditional_comments.tp_print = 0;
#endif
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
- PyObject *__pyx_t_10 = NULL;
+ int __pyx_t_10;
PyObject *__pyx_t_11 = NULL;
+ PyObject *__pyx_t_12 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
/* "lxml/html/clean.py":11
* from __future__ import absolute_import
*
- * import re # <<<<<<<<<<<<<<
- * import copy
- * try:
+ * import copy # <<<<<<<<<<<<<<
+ * import re
+ * import sys
*/
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_re, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_copy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_1) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_copy, __pyx_t_1) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "lxml/html/clean.py":12
*
+ * import copy
+ * import re # <<<<<<<<<<<<<<
+ * import sys
+ * try:
+ */
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_re, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_1) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "lxml/html/clean.py":13
+ * import copy
* import re
- * import copy # <<<<<<<<<<<<<<
+ * import sys # <<<<<<<<<<<<<<
* try:
* from urlparse import urlsplit
*/
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_copy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_copy, __pyx_t_1) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 13, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "lxml/html/clean.py":13
+ /* "lxml/html/clean.py":14
* import re
- * import copy
+ * import sys
* try: # <<<<<<<<<<<<<<
* from urlparse import urlsplit
* from urllib import unquote_plus
__Pyx_XGOTREF(__pyx_t_4);
/*try:*/ {
- /* "lxml/html/clean.py":14
- * import copy
+ /* "lxml/html/clean.py":15
+ * import sys
* try:
* from urlparse import urlsplit # <<<<<<<<<<<<<<
* from urllib import unquote_plus
* except ImportError:
*/
- __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L2_error)
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L2_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_n_s_urlsplit);
__Pyx_GIVEREF(__pyx_n_s_urlsplit);
PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_urlsplit);
- __pyx_t_5 = __Pyx_Import(__pyx_n_s_urlparse, __pyx_t_1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 14, __pyx_L2_error)
+ __pyx_t_5 = __Pyx_Import(__pyx_n_s_urlparse, __pyx_t_1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 15, __pyx_L2_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_urlsplit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L2_error)
+ __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_urlsplit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L2_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_urlsplit, __pyx_t_1) < 0) __PYX_ERR(0, 14, __pyx_L2_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_urlsplit, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L2_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":15
+ /* "lxml/html/clean.py":16
* try:
* from urlparse import urlsplit
* from urllib import unquote_plus # <<<<<<<<<<<<<<
* except ImportError:
* # Python 3
*/
- __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 15, __pyx_L2_error)
+ __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 16, __pyx_L2_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(__pyx_n_s_unquote_plus);
__Pyx_GIVEREF(__pyx_n_s_unquote_plus);
PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_unquote_plus);
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_urllib, __pyx_t_5, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L2_error)
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_urllib, __pyx_t_5, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L2_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_unquote_plus); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 15, __pyx_L2_error)
+ __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_unquote_plus); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 16, __pyx_L2_error)
__Pyx_GOTREF(__pyx_t_5);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_unquote_plus, __pyx_t_5) < 0) __PYX_ERR(0, 15, __pyx_L2_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_unquote_plus, __pyx_t_5) < 0) __PYX_ERR(0, 16, __pyx_L2_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "lxml/html/clean.py":13
+ /* "lxml/html/clean.py":14
* import re
- * import copy
+ * import sys
* try: # <<<<<<<<<<<<<<
* from urlparse import urlsplit
* from urllib import unquote_plus
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":16
+ /* "lxml/html/clean.py":17
* from urlparse import urlsplit
* from urllib import unquote_plus
* except ImportError: # <<<<<<<<<<<<<<
__pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
if (__pyx_t_6) {
__Pyx_AddTraceback("lxml.html.clean", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_7) < 0) __PYX_ERR(0, 16, __pyx_L4_except_error)
+ if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_7) < 0) __PYX_ERR(0, 17, __pyx_L4_except_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_t_7);
- /* "lxml/html/clean.py":18
+ /* "lxml/html/clean.py":19
* except ImportError:
* # Python 3
* from urllib.parse import urlsplit, unquote_plus # <<<<<<<<<<<<<<
* from lxml import etree
* from lxml.html import defs
*/
- __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 18, __pyx_L4_except_error)
+ __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 19, __pyx_L4_except_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_INCREF(__pyx_n_s_urlsplit);
__Pyx_GIVEREF(__pyx_n_s_urlsplit);
__Pyx_INCREF(__pyx_n_s_unquote_plus);
__Pyx_GIVEREF(__pyx_n_s_unquote_plus);
PyList_SET_ITEM(__pyx_t_8, 1, __pyx_n_s_unquote_plus);
- __pyx_t_9 = __Pyx_Import(__pyx_n_s_urllib_parse, __pyx_t_8, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 18, __pyx_L4_except_error)
+ __pyx_t_9 = __Pyx_Import(__pyx_n_s_urllib_parse, __pyx_t_8, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 19, __pyx_L4_except_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_ImportFrom(__pyx_t_9, __pyx_n_s_urlsplit); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 18, __pyx_L4_except_error)
+ __pyx_t_8 = __Pyx_ImportFrom(__pyx_t_9, __pyx_n_s_urlsplit); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 19, __pyx_L4_except_error)
__Pyx_GOTREF(__pyx_t_8);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_urlsplit, __pyx_t_8) < 0) __PYX_ERR(0, 18, __pyx_L4_except_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_urlsplit, __pyx_t_8) < 0) __PYX_ERR(0, 19, __pyx_L4_except_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_ImportFrom(__pyx_t_9, __pyx_n_s_unquote_plus); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 18, __pyx_L4_except_error)
+ __pyx_t_8 = __Pyx_ImportFrom(__pyx_t_9, __pyx_n_s_unquote_plus); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 19, __pyx_L4_except_error)
__Pyx_GOTREF(__pyx_t_8);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_unquote_plus, __pyx_t_8) < 0) __PYX_ERR(0, 18, __pyx_L4_except_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_unquote_plus, __pyx_t_8) < 0) __PYX_ERR(0, 19, __pyx_L4_except_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L4_except_error;
__pyx_L4_except_error:;
- /* "lxml/html/clean.py":13
+ /* "lxml/html/clean.py":14
* import re
- * import copy
+ * import sys
* try: # <<<<<<<<<<<<<<
* from urlparse import urlsplit
* from urllib import unquote_plus
__pyx_L7_try_end:;
}
- /* "lxml/html/clean.py":19
+ /* "lxml/html/clean.py":20
* # Python 3
* from urllib.parse import urlsplit, unquote_plus
* from lxml import etree # <<<<<<<<<<<<<<
* from lxml.html import defs
* from lxml.html import fromstring, XHTML_NAMESPACE
*/
- __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 19, __pyx_L1_error)
+ __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 20, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_n_s_etree);
__Pyx_GIVEREF(__pyx_n_s_etree);
PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_etree);
- __pyx_t_5 = __Pyx_Import(__pyx_n_s_lxml, __pyx_t_7, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 19, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_Import(__pyx_n_s_lxml, __pyx_t_7, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 20, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_etree); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 19, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_etree); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 20, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_etree, __pyx_t_7) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_etree, __pyx_t_7) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":20
+ /* "lxml/html/clean.py":21
* from urllib.parse import urlsplit, unquote_plus
* from lxml import etree
* from lxml.html import defs # <<<<<<<<<<<<<<
* from lxml.html import fromstring, XHTML_NAMESPACE
* from lxml.html import xhtml_to_html, _transform_result
*/
- __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 20, __pyx_L1_error)
+ __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 21, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(__pyx_n_s_defs);
__Pyx_GIVEREF(__pyx_n_s_defs);
PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_defs);
- __pyx_t_7 = __Pyx_Import(__pyx_n_s_lxml_html, __pyx_t_5, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 20, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_Import(__pyx_n_s_lxml_html, __pyx_t_5, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 21, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_defs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 20, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_defs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 21, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_defs, __pyx_t_5) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_defs, __pyx_t_5) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "lxml/html/clean.py":21
+ /* "lxml/html/clean.py":22
* from lxml import etree
* from lxml.html import defs
* from lxml.html import fromstring, XHTML_NAMESPACE # <<<<<<<<<<<<<<
* from lxml.html import xhtml_to_html, _transform_result
*
*/
- __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 21, __pyx_L1_error)
+ __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 22, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_n_s_fromstring);
__Pyx_GIVEREF(__pyx_n_s_fromstring);
__Pyx_INCREF(__pyx_n_s_XHTML_NAMESPACE);
__Pyx_GIVEREF(__pyx_n_s_XHTML_NAMESPACE);
PyList_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_XHTML_NAMESPACE);
- __pyx_t_5 = __Pyx_Import(__pyx_n_s_lxml_html, __pyx_t_7, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 21, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_Import(__pyx_n_s_lxml_html, __pyx_t_7, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 22, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_fromstring); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 21, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_fromstring); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 22, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_fromstring, __pyx_t_7) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_fromstring, __pyx_t_7) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_XHTML_NAMESPACE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 21, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_XHTML_NAMESPACE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 22, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_XHTML_NAMESPACE, __pyx_t_7) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_XHTML_NAMESPACE, __pyx_t_7) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":22
+ /* "lxml/html/clean.py":23
* from lxml.html import defs
* from lxml.html import fromstring, XHTML_NAMESPACE
* from lxml.html import xhtml_to_html, _transform_result # <<<<<<<<<<<<<<
*
* try:
*/
- __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 22, __pyx_L1_error)
+ __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 23, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(__pyx_n_s_xhtml_to_html);
__Pyx_GIVEREF(__pyx_n_s_xhtml_to_html);
__Pyx_INCREF(__pyx_n_s_transform_result);
__Pyx_GIVEREF(__pyx_n_s_transform_result);
PyList_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_transform_result);
- __pyx_t_7 = __Pyx_Import(__pyx_n_s_lxml_html, __pyx_t_5, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 22, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_Import(__pyx_n_s_lxml_html, __pyx_t_5, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 23, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_xhtml_to_html); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 22, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_xhtml_to_html); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 23, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_xhtml_to_html, __pyx_t_5) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_xhtml_to_html, __pyx_t_5) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_transform_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 22, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_transform_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 23, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_transform_result, __pyx_t_5) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_transform_result, __pyx_t_5) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "lxml/html/clean.py":24
+ /* "lxml/html/clean.py":25
* from lxml.html import xhtml_to_html, _transform_result
*
* try: # <<<<<<<<<<<<<<
__Pyx_XGOTREF(__pyx_t_2);
/*try:*/ {
- /* "lxml/html/clean.py":25
+ /* "lxml/html/clean.py":26
*
* try:
* unichr # <<<<<<<<<<<<<<
* except NameError:
* # Python 3
*/
- __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_unichr); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 25, __pyx_L10_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_unichr); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 26, __pyx_L10_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "lxml/html/clean.py":24
+ /* "lxml/html/clean.py":25
* from lxml.html import xhtml_to_html, _transform_result
*
* try: # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
- /* "lxml/html/clean.py":26
+ /* "lxml/html/clean.py":27
* try:
* unichr
* except NameError: # <<<<<<<<<<<<<<
__pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_NameError);
if (__pyx_t_6) {
__Pyx_AddTraceback("lxml.html.clean", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(0, 26, __pyx_L12_except_error)
+ if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(0, 27, __pyx_L12_except_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_t_1);
- /* "lxml/html/clean.py":28
+ /* "lxml/html/clean.py":29
* except NameError:
* # Python 3
* unichr = chr # <<<<<<<<<<<<<<
* try:
* unicode
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_unichr, __pyx_builtin_chr) < 0) __PYX_ERR(0, 28, __pyx_L12_except_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_unichr, __pyx_builtin_chr) < 0) __PYX_ERR(0, 29, __pyx_L12_except_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L12_except_error;
__pyx_L12_except_error:;
- /* "lxml/html/clean.py":24
+ /* "lxml/html/clean.py":25
* from lxml.html import xhtml_to_html, _transform_result
*
* try: # <<<<<<<<<<<<<<
__pyx_L15_try_end:;
}
- /* "lxml/html/clean.py":29
+ /* "lxml/html/clean.py":30
* # Python 3
* unichr = chr
* try: # <<<<<<<<<<<<<<
__Pyx_XGOTREF(__pyx_t_4);
/*try:*/ {
- /* "lxml/html/clean.py":30
+ /* "lxml/html/clean.py":31
* unichr = chr
* try:
* unicode # <<<<<<<<<<<<<<
* except NameError:
* # Python 3
*/
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L18_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L18_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "lxml/html/clean.py":29
+ /* "lxml/html/clean.py":30
* # Python 3
* unichr = chr
* try: # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
- /* "lxml/html/clean.py":31
+ /* "lxml/html/clean.py":32
* try:
* unicode
* except NameError: # <<<<<<<<<<<<<<
__pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_NameError);
if (__pyx_t_6) {
__Pyx_AddTraceback("lxml.html.clean", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_7) < 0) __PYX_ERR(0, 31, __pyx_L20_except_error)
+ if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_7) < 0) __PYX_ERR(0, 32, __pyx_L20_except_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_t_7);
- /* "lxml/html/clean.py":33
+ /* "lxml/html/clean.py":34
* except NameError:
* # Python 3
* unicode = str # <<<<<<<<<<<<<<
* try:
* basestring
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_unicode, ((PyObject *)(&PyString_Type))) < 0) __PYX_ERR(0, 33, __pyx_L20_except_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_unicode, ((PyObject *)(&PyString_Type))) < 0) __PYX_ERR(0, 34, __pyx_L20_except_error)
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L20_except_error;
__pyx_L20_except_error:;
- /* "lxml/html/clean.py":29
+ /* "lxml/html/clean.py":30
* # Python 3
* unichr = chr
* try: # <<<<<<<<<<<<<<
__pyx_L23_try_end:;
}
- /* "lxml/html/clean.py":34
+ /* "lxml/html/clean.py":35
* # Python 3
* unicode = str
* try: # <<<<<<<<<<<<<<
__Pyx_XGOTREF(__pyx_t_2);
/*try:*/ {
- /* "lxml/html/clean.py":35
+ /* "lxml/html/clean.py":36
* unicode = str
* try:
* basestring # <<<<<<<<<<<<<<
* except NameError:
* basestring = (str, bytes)
*/
- __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_basestring); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 35, __pyx_L26_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_basestring); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 36, __pyx_L26_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "lxml/html/clean.py":34
+ /* "lxml/html/clean.py":35
* # Python 3
* unicode = str
* try: # <<<<<<<<<<<<<<
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
- /* "lxml/html/clean.py":36
+ /* "lxml/html/clean.py":37
* try:
* basestring
* except NameError: # <<<<<<<<<<<<<<
__pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_NameError);
if (__pyx_t_6) {
__Pyx_AddTraceback("lxml.html.clean", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(0, 36, __pyx_L28_except_error)
+ if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(0, 37, __pyx_L28_except_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_t_1);
- /* "lxml/html/clean.py":37
+ /* "lxml/html/clean.py":38
* basestring
* except NameError:
* basestring = (str, bytes) # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 37, __pyx_L28_except_error)
+ __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 38, __pyx_L28_except_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_INCREF(((PyObject *)(&PyString_Type)));
__Pyx_GIVEREF(((PyObject *)(&PyString_Type)));
__Pyx_INCREF(((PyObject *)(&PyBytes_Type)));
__Pyx_GIVEREF(((PyObject *)(&PyBytes_Type)));
PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)(&PyBytes_Type)));
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_basestring, __pyx_t_9) < 0) __PYX_ERR(0, 37, __pyx_L28_except_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_basestring, __pyx_t_9) < 0) __PYX_ERR(0, 38, __pyx_L28_except_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
goto __pyx_L28_except_error;
__pyx_L28_except_error:;
- /* "lxml/html/clean.py":34
+ /* "lxml/html/clean.py":35
* # Python 3
* unicode = str
* try: # <<<<<<<<<<<<<<
__pyx_L31_try_end:;
}
- /* "lxml/html/clean.py":40
+ /* "lxml/html/clean.py":41
*
*
* __all__ = ['clean_html', 'clean', 'Cleaner', 'autolink', 'autolink_html', # <<<<<<<<<<<<<<
* 'word_break', 'word_break_html']
*
*/
- __pyx_t_1 = PyList_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error)
+ __pyx_t_1 = PyList_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_n_s_clean_html);
__Pyx_GIVEREF(__pyx_n_s_clean_html);
__Pyx_INCREF(__pyx_n_s_word_break_html);
__Pyx_GIVEREF(__pyx_n_s_word_break_html);
PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_s_word_break_html);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 40, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "lxml/html/clean.py":64
+ /* "lxml/html/clean.py":65
* # This is an IE-specific construct you can have in a stylesheet to
* # run some Javascript:
- * _css_javascript_re = re.compile( # <<<<<<<<<<<<<<
- * r'expression\s*\(.*?\)', re.S|re.I)
+ * _replace_css_javascript = re.compile( # <<<<<<<<<<<<<<
+ * r'expression\s*\(.*?\)', re.S|re.I).sub
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_compile); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 64, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_compile); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 65, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "lxml/html/clean.py":65
+ /* "lxml/html/clean.py":66
* # run some Javascript:
- * _css_javascript_re = re.compile(
- * r'expression\s*\(.*?\)', re.S|re.I) # <<<<<<<<<<<<<<
+ * _replace_css_javascript = re.compile(
+ * r'expression\s*\(.*?\)', re.S|re.I).sub # <<<<<<<<<<<<<<
*
* # Do I have to worry about @\nimport?
*/
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_S); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 65, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_S); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 66, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_I); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 65, __pyx_L1_error)
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_I); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 66, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_Or(__pyx_t_7, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
+ __pyx_t_1 = PyNumber_Or(__pyx_t_7, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- /* "lxml/html/clean.py":64
+ /* "lxml/html/clean.py":65
* # This is an IE-specific construct you can have in a stylesheet to
* # run some Javascript:
- * _css_javascript_re = re.compile( # <<<<<<<<<<<<<<
- * r'expression\s*\(.*?\)', re.S|re.I)
+ * _replace_css_javascript = re.compile( # <<<<<<<<<<<<<<
+ * r'expression\s*\(.*?\)', re.S|re.I).sub
*
*/
- __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 64, __pyx_L1_error)
+ __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 65, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_INCREF(__pyx_kp_s_expression_s);
__Pyx_GIVEREF(__pyx_kp_s_expression_s);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_css_javascript_re, __pyx_t_1) < 0) __PYX_ERR(0, 64, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "lxml/html/clean.py":68
+ /* "lxml/html/clean.py":66
+ * # run some Javascript:
+ * _replace_css_javascript = re.compile(
+ * r'expression\s*\(.*?\)', re.S|re.I).sub # <<<<<<<<<<<<<<
*
* # Do I have to worry about @\nimport?
- * _css_import_re = re.compile( # <<<<<<<<<<<<<<
- * r'@\s*import', re.I)
- *
*/
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_compile); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 68, __pyx_L1_error)
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sub); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 66, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_replace_css_javascript, __pyx_t_9) < 0) __PYX_ERR(0, 65, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
/* "lxml/html/clean.py":69
+ *
* # Do I have to worry about @\nimport?
- * _css_import_re = re.compile(
- * r'@\s*import', re.I) # <<<<<<<<<<<<<<
+ * _replace_css_import = re.compile( # <<<<<<<<<<<<<<
+ * r'@\s*import', re.I).sub
*
- * # All kinds of schemes besides just javascript: that can cause
*/
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_re); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 69, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_compile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_I); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 69, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+
+ /* "lxml/html/clean.py":70
+ * # Do I have to worry about @\nimport?
+ * _replace_css_import = re.compile(
+ * r'@\s*import', re.I).sub # <<<<<<<<<<<<<<
+ *
+ * _looks_like_tag_content = re.compile(
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_re); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 70, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_I); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 70, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- /* "lxml/html/clean.py":68
+ /* "lxml/html/clean.py":69
*
* # Do I have to worry about @\nimport?
- * _css_import_re = re.compile( # <<<<<<<<<<<<<<
- * r'@\s*import', re.I)
+ * _replace_css_import = re.compile( # <<<<<<<<<<<<<<
+ * r'@\s*import', re.I).sub
*
*/
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 69, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
__Pyx_INCREF(__pyx_kp_s_s_import);
__Pyx_GIVEREF(__pyx_kp_s_s_import);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_s_import);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_kp_s_s_import);
__Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_5);
__pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 68, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 69, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_css_import_re, __pyx_t_5) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+
+ /* "lxml/html/clean.py":70
+ * # Do I have to worry about @\nimport?
+ * _replace_css_import = re.compile(
+ * r'@\s*import', re.I).sub # <<<<<<<<<<<<<<
+ *
+ * _looks_like_tag_content = re.compile(
+ */
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sub); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 70, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_replace_css_import, __pyx_t_9) < 0) __PYX_ERR(0, 69, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+
+ /* "lxml/html/clean.py":72
+ * r'@\s*import', re.I).sub
+ *
+ * _looks_like_tag_content = re.compile( # <<<<<<<<<<<<<<
+ * r'</?[a-zA-Z]+|\son[a-zA-Z]+\s*=',
+ * *((re.ASCII,) if sys.version_info[0] >= 3 else ())).search
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_re); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 72, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_compile); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 72, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+
+ /* "lxml/html/clean.py":74
+ * _looks_like_tag_content = re.compile(
+ * r'</?[a-zA-Z]+|\son[a-zA-Z]+\s*=',
+ * *((re.ASCII,) if sys.version_info[0] >= 3 else ())).search # <<<<<<<<<<<<<<
+ *
+ * # All kinds of schemes besides just javascript: that can cause
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_version_info); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 74, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 74, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 74, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ if (__pyx_t_10) {
+ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 74, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_ASCII); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 74, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
+ __pyx_t_1 = 0;
+ __pyx_t_9 = __pyx_t_7;
+ __pyx_t_7 = 0;
+ } else {
+ __Pyx_INCREF(__pyx_empty_tuple);
+ __pyx_t_9 = __pyx_empty_tuple;
+ }
+ if (unlikely(__pyx_t_9 == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+ __PYX_ERR(0, 74, __pyx_L1_error)
+ }
+
+ /* "lxml/html/clean.py":72
+ * r'@\s*import', re.I).sub
+ *
+ * _looks_like_tag_content = re.compile( # <<<<<<<<<<<<<<
+ * r'</?[a-zA-Z]+|\son[a-zA-Z]+\s*=',
+ * *((re.ASCII,) if sys.version_info[0] >= 3 else ())).search
+ */
+ __pyx_t_7 = PyNumber_Add(__pyx_tuple__18, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 72, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 72, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+ /* "lxml/html/clean.py":74
+ * _looks_like_tag_content = re.compile(
+ * r'</?[a-zA-Z]+|\son[a-zA-Z]+\s*=',
+ * *((re.ASCII,) if sys.version_info[0] >= 3 else ())).search # <<<<<<<<<<<<<<
+ *
+ * # All kinds of schemes besides just javascript: that can cause
+ */
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_search); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 74, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_looks_like_tag_content, __pyx_t_7) < 0) __PYX_ERR(0, 72, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "lxml/html/clean.py":73
+ /* "lxml/html/clean.py":78
* # All kinds of schemes besides just javascript: that can cause
* # execution:
* _is_image_dataurl = re.compile( # <<<<<<<<<<<<<<
* r'^data:image/.+;base64', re.I).search
* _is_possibly_malicious_scheme = re.compile(
*/
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 73, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_compile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 78, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_compile); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 78, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "lxml/html/clean.py":74
+ /* "lxml/html/clean.py":79
* # execution:
* _is_image_dataurl = re.compile(
* r'^data:image/.+;base64', re.I).search # <<<<<<<<<<<<<<
* _is_possibly_malicious_scheme = re.compile(
* r'(?:javascript|jscript|livescript|vbscript|data|about|mocha):',
*/
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 74, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 79, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_I); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 79, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_I); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 74, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "lxml/html/clean.py":73
+ /* "lxml/html/clean.py":78
* # All kinds of schemes besides just javascript: that can cause
* # execution:
* _is_image_dataurl = re.compile( # <<<<<<<<<<<<<<
* r'^data:image/.+;base64', re.I).search
* _is_possibly_malicious_scheme = re.compile(
*/
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 73, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 78, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_kp_s_data_image_base64);
__Pyx_GIVEREF(__pyx_kp_s_data_image_base64);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_s_data_image_base64);
- __Pyx_GIVEREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_9);
- __pyx_t_9 = 0;
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 73, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_kp_s_data_image_base64);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "lxml/html/clean.py":74
+ /* "lxml/html/clean.py":79
* # execution:
* _is_image_dataurl = re.compile(
* r'^data:image/.+;base64', re.I).search # <<<<<<<<<<<<<<
* _is_possibly_malicious_scheme = re.compile(
* r'(?:javascript|jscript|livescript|vbscript|data|about|mocha):',
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_search); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 74, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_image_dataurl, __pyx_t_5) < 0) __PYX_ERR(0, 73, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_search); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 79, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_image_dataurl, __pyx_t_7) < 0) __PYX_ERR(0, 78, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "lxml/html/clean.py":75
+ /* "lxml/html/clean.py":80
* _is_image_dataurl = re.compile(
* r'^data:image/.+;base64', re.I).search
* _is_possibly_malicious_scheme = re.compile( # <<<<<<<<<<<<<<
* r'(?:javascript|jscript|livescript|vbscript|data|about|mocha):',
* re.I).search
*/
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 75, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 80, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_compile); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 80, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_compile); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 75, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "lxml/html/clean.py":77
+ /* "lxml/html/clean.py":82
* _is_possibly_malicious_scheme = re.compile(
* r'(?:javascript|jscript|livescript|vbscript|data|about|mocha):',
* re.I).search # <<<<<<<<<<<<<<
* def _is_javascript_scheme(s):
* if _is_image_dataurl(s):
*/
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 77, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_I); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 82, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_I); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 82, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "lxml/html/clean.py":75
+ /* "lxml/html/clean.py":80
* _is_image_dataurl = re.compile(
* r'^data:image/.+;base64', re.I).search
* _is_possibly_malicious_scheme = re.compile( # <<<<<<<<<<<<<<
* r'(?:javascript|jscript|livescript|vbscript|data|about|mocha):',
* re.I).search
*/
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 75, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 80, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_kp_s_javascript_jscript_livescript_v);
__Pyx_GIVEREF(__pyx_kp_s_javascript_jscript_livescript_v);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_s_javascript_jscript_livescript_v);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_kp_s_javascript_jscript_livescript_v);
+ __Pyx_GIVEREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_9);
+ __pyx_t_9 = 0;
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 80, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "lxml/html/clean.py":77
+ /* "lxml/html/clean.py":82
* _is_possibly_malicious_scheme = re.compile(
* r'(?:javascript|jscript|livescript|vbscript|data|about|mocha):',
* re.I).search # <<<<<<<<<<<<<<
* def _is_javascript_scheme(s):
* if _is_image_dataurl(s):
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_search); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 77, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_possibly_malicious_scheme, __pyx_t_5) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_search); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 82, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_possibly_malicious_scheme, __pyx_t_7) < 0) __PYX_ERR(0, 80, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "lxml/html/clean.py":78
+ /* "lxml/html/clean.py":83
* r'(?:javascript|jscript|livescript|vbscript|data|about|mocha):',
* re.I).search
* def _is_javascript_scheme(s): # <<<<<<<<<<<<<<
* if _is_image_dataurl(s):
* return None
*/
- __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_1_is_javascript_scheme, 0, __pyx_n_s_is_javascript_scheme, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_javascript_scheme, __pyx_t_5) < 0) __PYX_ERR(0, 78, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_1_is_javascript_scheme, 0, __pyx_n_s_is_javascript_scheme, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 83, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_javascript_scheme, __pyx_t_7) < 0) __PYX_ERR(0, 83, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "lxml/html/clean.py":83
+ /* "lxml/html/clean.py":88
* return _is_possibly_malicious_scheme(s)
*
* _substitute_whitespace = re.compile(r'[\s\x00-\x08\x0B\x0C\x0E-\x19]+').sub # <<<<<<<<<<<<<<
* # FIXME: should data: be blocked?
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 83, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_compile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 83, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_substitute_whitespace, __pyx_t_1) < 0) __PYX_ERR(0, 83, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 88, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_compile); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 88, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 88, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_sub); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 88, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_substitute_whitespace, __pyx_t_9) < 0) __PYX_ERR(0, 88, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- /* "lxml/html/clean.py":87
+ /* "lxml/html/clean.py":92
*
* # FIXME: check against: http://msdn2.microsoft.com/en-us/library/ms537512.aspx
* _conditional_comment_re = re.compile( # <<<<<<<<<<<<<<
* r'\[if[\s\n\r]+.*?][\s\n\r]*>', re.I|re.S)
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_compile); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 87, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_re); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 92, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_compile); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 92, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- /* "lxml/html/clean.py":88
+ /* "lxml/html/clean.py":93
* # FIXME: check against: http://msdn2.microsoft.com/en-us/library/ms537512.aspx
* _conditional_comment_re = re.compile(
* r'\[if[\s\n\r]+.*?][\s\n\r]*>', re.I|re.S) # <<<<<<<<<<<<<<
*
* _find_styled_elements = etree.XPath(
*/
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_I); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 88, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_re); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 93, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_S); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 88, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_Or(__pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_I); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 93, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_re); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 93, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_S); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_9 = PyNumber_Or(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 93, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "lxml/html/clean.py":87
+ /* "lxml/html/clean.py":92
*
* # FIXME: check against: http://msdn2.microsoft.com/en-us/library/ms537512.aspx
* _conditional_comment_re = re.compile( # <<<<<<<<<<<<<<
* r'\[if[\s\n\r]+.*?][\s\n\r]*>', re.I|re.S)
*
*/
- __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 87, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_kp_s_if_s_n_r_s_n_r);
__Pyx_GIVEREF(__pyx_kp_s_if_s_n_r_s_n_r);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_kp_s_if_s_n_r_s_n_r);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_if_s_n_r_s_n_r);
+ __Pyx_GIVEREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_9);
+ __pyx_t_9 = 0;
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 92, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_conditional_comment_re, __pyx_t_1) < 0) __PYX_ERR(0, 87, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_conditional_comment_re, __pyx_t_9) < 0) __PYX_ERR(0, 92, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- /* "lxml/html/clean.py":90
+ /* "lxml/html/clean.py":95
* r'\[if[\s\n\r]+.*?][\s\n\r]*>', re.I|re.S)
*
* _find_styled_elements = etree.XPath( # <<<<<<<<<<<<<<
* "descendant-or-self::*[@style]")
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_etree); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_XPath); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 90, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_etree); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 95, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_XPath); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_find_styled_elements, __pyx_t_1) < 0) __PYX_ERR(0, 90, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 95, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_find_styled_elements, __pyx_t_9) < 0) __PYX_ERR(0, 95, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- /* "lxml/html/clean.py":93
+ /* "lxml/html/clean.py":98
* "descendant-or-self::*[@style]")
*
* _find_external_links = etree.XPath( # <<<<<<<<<<<<<<
* ("descendant-or-self::a [normalize-space(@href) and substring(normalize-space(@href),1,1) != '#'] |"
* "descendant-or-self::x:a[normalize-space(@href) and substring(normalize-space(@href),1,1) != '#']"),
*/
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_etree); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_etree); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 98, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_XPath); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_XPath); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 93, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- /* "lxml/html/clean.py":96
+ /* "lxml/html/clean.py":101
* ("descendant-or-self::a [normalize-space(@href) and substring(normalize-space(@href),1,1) != '#'] |"
* "descendant-or-self::x:a[normalize-space(@href) and substring(normalize-space(@href),1,1) != '#']"),
* namespaces={'x':XHTML_NAMESPACE}) # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 96, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_XHTML_NAMESPACE); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 96, __pyx_L1_error)
+ __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 101, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_x, __pyx_t_9) < 0) __PYX_ERR(0, 96, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_namespaces, __pyx_t_5) < 0) __PYX_ERR(0, 96, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 101, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_XHTML_NAMESPACE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 101, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_x, __pyx_t_5) < 0) __PYX_ERR(0, 101, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_namespaces, __pyx_t_7) < 0) __PYX_ERR(0, 101, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "lxml/html/clean.py":93
+ /* "lxml/html/clean.py":98
* "descendant-or-self::*[@style]")
*
* _find_external_links = etree.XPath( # <<<<<<<<<<<<<<
* ("descendant-or-self::a [normalize-space(@href) and substring(normalize-space(@href),1,1) != '#'] |"
* "descendant-or-self::x:a[normalize-space(@href) and substring(normalize-space(@href),1,1) != '#']"),
*/
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__22, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 93, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__23, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 98, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_find_external_links, __pyx_t_5) < 0) __PYX_ERR(0, 93, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_find_external_links, __pyx_t_7) < 0) __PYX_ERR(0, 98, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "lxml/html/clean.py":99
+ /* "lxml/html/clean.py":104
*
*
* class Cleaner(object): # <<<<<<<<<<<<<<
* """
* Instances cleans the document of each of the possible offending
*/
- __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__23); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 99, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_tuple__23, __pyx_n_s_Cleaner, __pyx_n_s_Cleaner, (PyObject *) NULL, __pyx_n_s_lxml_html_clean, __pyx_kp_s_Instances_cleans_the_document_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__24); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 104, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_9 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_tuple__24, __pyx_n_s_Cleaner, __pyx_n_s_Cleaner, (PyObject *) NULL, __pyx_n_s_lxml_html_clean, __pyx_kp_s_Instances_cleans_the_document_o); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 104, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
- /* "lxml/html/clean.py":194
+ /* "lxml/html/clean.py":199
* """
*
* scripts = True # <<<<<<<<<<<<<<
* javascript = True
* comments = True
*/
- if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_scripts, Py_True) < 0) __PYX_ERR(0, 194, __pyx_L1_error)
+ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_scripts, Py_True) < 0) __PYX_ERR(0, 199, __pyx_L1_error)
- /* "lxml/html/clean.py":195
+ /* "lxml/html/clean.py":200
*
* scripts = True
* javascript = True # <<<<<<<<<<<<<<
* comments = True
* style = False
*/
- if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_javascript, Py_True) < 0) __PYX_ERR(0, 195, __pyx_L1_error)
+ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_javascript, Py_True) < 0) __PYX_ERR(0, 200, __pyx_L1_error)
- /* "lxml/html/clean.py":196
+ /* "lxml/html/clean.py":201
* scripts = True
* javascript = True
* comments = True # <<<<<<<<<<<<<<
* style = False
* inline_style = None
*/
- if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_comments, Py_True) < 0) __PYX_ERR(0, 196, __pyx_L1_error)
+ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_comments, Py_True) < 0) __PYX_ERR(0, 201, __pyx_L1_error)
- /* "lxml/html/clean.py":197
+ /* "lxml/html/clean.py":202
* javascript = True
* comments = True
* style = False # <<<<<<<<<<<<<<
* inline_style = None
* links = True
*/
- if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_style, Py_False) < 0) __PYX_ERR(0, 197, __pyx_L1_error)
+ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_style, Py_False) < 0) __PYX_ERR(0, 202, __pyx_L1_error)
- /* "lxml/html/clean.py":198
+ /* "lxml/html/clean.py":203
* comments = True
* style = False
* inline_style = None # <<<<<<<<<<<<<<
* links = True
* meta = True
*/
- if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_inline_style, Py_None) < 0) __PYX_ERR(0, 198, __pyx_L1_error)
+ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_inline_style, Py_None) < 0) __PYX_ERR(0, 203, __pyx_L1_error)
- /* "lxml/html/clean.py":199
+ /* "lxml/html/clean.py":204
* style = False
* inline_style = None
* links = True # <<<<<<<<<<<<<<
* meta = True
* page_structure = True
*/
- if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_links, Py_True) < 0) __PYX_ERR(0, 199, __pyx_L1_error)
+ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_links, Py_True) < 0) __PYX_ERR(0, 204, __pyx_L1_error)
- /* "lxml/html/clean.py":200
+ /* "lxml/html/clean.py":205
* inline_style = None
* links = True
* meta = True # <<<<<<<<<<<<<<
* page_structure = True
* processing_instructions = True
*/
- if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_meta, Py_True) < 0) __PYX_ERR(0, 200, __pyx_L1_error)
+ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_meta, Py_True) < 0) __PYX_ERR(0, 205, __pyx_L1_error)
- /* "lxml/html/clean.py":201
+ /* "lxml/html/clean.py":206
* links = True
* meta = True
* page_structure = True # <<<<<<<<<<<<<<
* processing_instructions = True
* embedded = True
*/
- if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_page_structure, Py_True) < 0) __PYX_ERR(0, 201, __pyx_L1_error)
+ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_page_structure, Py_True) < 0) __PYX_ERR(0, 206, __pyx_L1_error)
- /* "lxml/html/clean.py":202
+ /* "lxml/html/clean.py":207
* meta = True
* page_structure = True
* processing_instructions = True # <<<<<<<<<<<<<<
* embedded = True
* frames = True
*/
- if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_processing_instructions, Py_True) < 0) __PYX_ERR(0, 202, __pyx_L1_error)
+ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_processing_instructions, Py_True) < 0) __PYX_ERR(0, 207, __pyx_L1_error)
- /* "lxml/html/clean.py":203
+ /* "lxml/html/clean.py":208
* page_structure = True
* processing_instructions = True
* embedded = True # <<<<<<<<<<<<<<
* frames = True
* forms = True
*/
- if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_embedded, Py_True) < 0) __PYX_ERR(0, 203, __pyx_L1_error)
+ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_embedded, Py_True) < 0) __PYX_ERR(0, 208, __pyx_L1_error)
- /* "lxml/html/clean.py":204
+ /* "lxml/html/clean.py":209
* processing_instructions = True
* embedded = True
* frames = True # <<<<<<<<<<<<<<
* forms = True
* annoying_tags = True
*/
- if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_frames, Py_True) < 0) __PYX_ERR(0, 204, __pyx_L1_error)
+ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_frames, Py_True) < 0) __PYX_ERR(0, 209, __pyx_L1_error)
- /* "lxml/html/clean.py":205
+ /* "lxml/html/clean.py":210
* embedded = True
* frames = True
* forms = True # <<<<<<<<<<<<<<
* annoying_tags = True
* remove_tags = None
*/
- if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_forms, Py_True) < 0) __PYX_ERR(0, 205, __pyx_L1_error)
+ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_forms, Py_True) < 0) __PYX_ERR(0, 210, __pyx_L1_error)
- /* "lxml/html/clean.py":206
+ /* "lxml/html/clean.py":211
* frames = True
* forms = True
* annoying_tags = True # <<<<<<<<<<<<<<
* remove_tags = None
* allow_tags = None
*/
- if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_annoying_tags, Py_True) < 0) __PYX_ERR(0, 206, __pyx_L1_error)
+ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_annoying_tags, Py_True) < 0) __PYX_ERR(0, 211, __pyx_L1_error)
- /* "lxml/html/clean.py":207
+ /* "lxml/html/clean.py":212
* forms = True
* annoying_tags = True
* remove_tags = None # <<<<<<<<<<<<<<
* allow_tags = None
* kill_tags = None
*/
- if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_remove_tags, Py_None) < 0) __PYX_ERR(0, 207, __pyx_L1_error)
+ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_remove_tags, Py_None) < 0) __PYX_ERR(0, 212, __pyx_L1_error)
- /* "lxml/html/clean.py":208
+ /* "lxml/html/clean.py":213
* annoying_tags = True
* remove_tags = None
* allow_tags = None # <<<<<<<<<<<<<<
* kill_tags = None
* remove_unknown_tags = True
*/
- if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_allow_tags, Py_None) < 0) __PYX_ERR(0, 208, __pyx_L1_error)
+ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_allow_tags, Py_None) < 0) __PYX_ERR(0, 213, __pyx_L1_error)
- /* "lxml/html/clean.py":209
+ /* "lxml/html/clean.py":214
* remove_tags = None
* allow_tags = None
* kill_tags = None # <<<<<<<<<<<<<<
* remove_unknown_tags = True
* safe_attrs_only = True
*/
- if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_kill_tags, Py_None) < 0) __PYX_ERR(0, 209, __pyx_L1_error)
+ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_kill_tags, Py_None) < 0) __PYX_ERR(0, 214, __pyx_L1_error)
- /* "lxml/html/clean.py":210
+ /* "lxml/html/clean.py":215
* allow_tags = None
* kill_tags = None
* remove_unknown_tags = True # <<<<<<<<<<<<<<
* safe_attrs_only = True
* safe_attrs = defs.safe_attrs
*/
- if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_remove_unknown_tags, Py_True) < 0) __PYX_ERR(0, 210, __pyx_L1_error)
+ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_remove_unknown_tags, Py_True) < 0) __PYX_ERR(0, 215, __pyx_L1_error)
- /* "lxml/html/clean.py":211
+ /* "lxml/html/clean.py":216
* kill_tags = None
* remove_unknown_tags = True
* safe_attrs_only = True # <<<<<<<<<<<<<<
* safe_attrs = defs.safe_attrs
* add_nofollow = False
*/
- if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_safe_attrs_only, Py_True) < 0) __PYX_ERR(0, 211, __pyx_L1_error)
+ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_safe_attrs_only, Py_True) < 0) __PYX_ERR(0, 216, __pyx_L1_error)
- /* "lxml/html/clean.py":212
+ /* "lxml/html/clean.py":217
* remove_unknown_tags = True
* safe_attrs_only = True
* safe_attrs = defs.safe_attrs # <<<<<<<<<<<<<<
* add_nofollow = False
* host_whitelist = ()
*/
- __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_defs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 212, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_safe_attrs); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 212, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_safe_attrs, __pyx_t_9) < 0) __PYX_ERR(0, 212, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_defs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_safe_attrs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 217, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_safe_attrs, __pyx_t_5) < 0) __PYX_ERR(0, 217, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":213
+ /* "lxml/html/clean.py":218
* safe_attrs_only = True
* safe_attrs = defs.safe_attrs
* add_nofollow = False # <<<<<<<<<<<<<<
* host_whitelist = ()
* whitelist_tags = {'iframe', 'embed'}
*/
- if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_add_nofollow, Py_False) < 0) __PYX_ERR(0, 213, __pyx_L1_error)
+ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_add_nofollow, Py_False) < 0) __PYX_ERR(0, 218, __pyx_L1_error)
- /* "lxml/html/clean.py":214
+ /* "lxml/html/clean.py":219
* safe_attrs = defs.safe_attrs
* add_nofollow = False
* host_whitelist = () # <<<<<<<<<<<<<<
* whitelist_tags = {'iframe', 'embed'}
*
*/
- if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_host_whitelist, __pyx_empty_tuple) < 0) __PYX_ERR(0, 214, __pyx_L1_error)
+ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_host_whitelist, __pyx_empty_tuple) < 0) __PYX_ERR(0, 219, __pyx_L1_error)
- /* "lxml/html/clean.py":215
+ /* "lxml/html/clean.py":220
* add_nofollow = False
* host_whitelist = ()
* whitelist_tags = {'iframe', 'embed'} # <<<<<<<<<<<<<<
*
* def __init__(self, **kw):
*/
- __pyx_t_9 = PySet_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 215, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- if (PySet_Add(__pyx_t_9, __pyx_n_s_iframe) < 0) __PYX_ERR(0, 215, __pyx_L1_error)
- if (PySet_Add(__pyx_t_9, __pyx_n_s_embed) < 0) __PYX_ERR(0, 215, __pyx_L1_error)
- if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_whitelist_tags, __pyx_t_9) < 0) __PYX_ERR(0, 215, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_5 = PySet_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 220, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (PySet_Add(__pyx_t_5, __pyx_n_s_iframe) < 0) __PYX_ERR(0, 220, __pyx_L1_error)
+ if (PySet_Add(__pyx_t_5, __pyx_n_s_embed) < 0) __PYX_ERR(0, 220, __pyx_L1_error)
+ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_whitelist_tags, __pyx_t_5) < 0) __PYX_ERR(0, 220, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":217
+ /* "lxml/html/clean.py":222
* whitelist_tags = {'iframe', 'embed'}
*
* def __init__(self, **kw): # <<<<<<<<<<<<<<
* not_an_attribute = object()
* for name, value in kw.items():
*/
- __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_1__init__, 0, __pyx_n_s_Cleaner___init, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 217, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init, __pyx_t_9) < 0) __PYX_ERR(0, 217, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_1__init__, 0, __pyx_n_s_Cleaner___init, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 222, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_init, __pyx_t_5) < 0) __PYX_ERR(0, 222, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":238
+ /* "lxml/html/clean.py":243
* # removal:
* _tag_link_attrs = dict(
* script='src', # <<<<<<<<<<<<<<
* link='href',
* # From: http://java.sun.com/j2se/1.4.2/docs/guide/misc/applet.html
*/
- __pyx_t_9 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 238, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_script, __pyx_n_s_src) < 0) __PYX_ERR(0, 238, __pyx_L1_error)
- if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_link, __pyx_n_s_href) < 0) __PYX_ERR(0, 238, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 243, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_script, __pyx_n_s_src) < 0) __PYX_ERR(0, 243, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_link, __pyx_n_s_href) < 0) __PYX_ERR(0, 243, __pyx_L1_error)
- /* "lxml/html/clean.py":242
+ /* "lxml/html/clean.py":247
* # From: http://java.sun.com/j2se/1.4.2/docs/guide/misc/applet.html
* # From what I can tell, both attributes can contain a link:
* applet=['code', 'object'], # <<<<<<<<<<<<<<
* iframe='src',
* embed='src',
*/
- __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 242, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_n_s_code);
__Pyx_GIVEREF(__pyx_n_s_code);
- PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_code);
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_code);
__Pyx_INCREF(__pyx_n_s_object);
__Pyx_GIVEREF(__pyx_n_s_object);
- PyList_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_object);
- if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_applet, __pyx_t_7) < 0) __PYX_ERR(0, 238, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_iframe, __pyx_n_s_src) < 0) __PYX_ERR(0, 238, __pyx_L1_error)
- if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_embed, __pyx_n_s_src) < 0) __PYX_ERR(0, 238, __pyx_L1_error)
- if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_layer, __pyx_n_s_src) < 0) __PYX_ERR(0, 238, __pyx_L1_error)
- if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_a, __pyx_n_s_href) < 0) __PYX_ERR(0, 238, __pyx_L1_error)
- if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_tag_link_attrs, __pyx_t_9) < 0) __PYX_ERR(0, 237, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-
- /* "lxml/html/clean.py":257
+ PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_object);
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_applet, __pyx_t_1) < 0) __PYX_ERR(0, 243, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_iframe, __pyx_n_s_src) < 0) __PYX_ERR(0, 243, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_embed, __pyx_n_s_src) < 0) __PYX_ERR(0, 243, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_layer, __pyx_n_s_src) < 0) __PYX_ERR(0, 243, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_a, __pyx_n_s_href) < 0) __PYX_ERR(0, 243, __pyx_L1_error)
+ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_tag_link_attrs, __pyx_t_5) < 0) __PYX_ERR(0, 242, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
+ /* "lxml/html/clean.py":262
* )
*
* def __call__(self, doc): # <<<<<<<<<<<<<<
* """
* Cleans the document.
*/
- __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_3__call__, 0, __pyx_n_s_Cleaner___call, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 257, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_call, __pyx_t_9) < 0) __PYX_ERR(0, 257, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_3__call__, 0, __pyx_n_s_Cleaner___call, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 262, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_call, __pyx_t_5) < 0) __PYX_ERR(0, 262, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":442
+ /* "lxml/html/clean.py":447
* el.set('rel', rel)
*
* def allow_follow(self, anchor): # <<<<<<<<<<<<<<
* """
* Override to suppress rel="nofollow" on some anchors.
*/
- __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_5allow_follow, 0, __pyx_n_s_Cleaner_allow_follow, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 442, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_allow_follow, __pyx_t_9) < 0) __PYX_ERR(0, 442, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_5allow_follow, 0, __pyx_n_s_Cleaner_allow_follow, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 447, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_allow_follow, __pyx_t_5) < 0) __PYX_ERR(0, 447, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":448
+ /* "lxml/html/clean.py":453
* return False
*
* def allow_element(self, el): # <<<<<<<<<<<<<<
* """
* Decide whether an element is configured to be accepted or rejected.
*/
- __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_7allow_element, 0, __pyx_n_s_Cleaner_allow_element, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 448, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_allow_element, __pyx_t_9) < 0) __PYX_ERR(0, 448, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_7allow_element, 0, __pyx_n_s_Cleaner_allow_element, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 453, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_allow_element, __pyx_t_5) < 0) __PYX_ERR(0, 453, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":472
+ /* "lxml/html/clean.py":477
* return self.allow_embedded_url(el, url)
*
* def allow_embedded_url(self, el, url): # <<<<<<<<<<<<<<
* """
* Decide whether a URL that was found in an element's attributes or text
*/
- __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_9allow_embedded_url, 0, __pyx_n_s_Cleaner_allow_embedded_url, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 472, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_allow_embedded_url, __pyx_t_9) < 0) __PYX_ERR(0, 472, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_9allow_embedded_url, 0, __pyx_n_s_Cleaner_allow_embedded_url, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 477, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_allow_embedded_url, __pyx_t_5) < 0) __PYX_ERR(0, 477, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":491
+ /* "lxml/html/clean.py":496
* return False
*
* def kill_conditional_comments(self, doc): # <<<<<<<<<<<<<<
* """
* IE conditional comments basically embed HTML that the parser
*/
- __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_11kill_conditional_comments, 0, __pyx_n_s_Cleaner_kill_conditional_comment_2, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 491, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_kill_conditional_comments, __pyx_t_9) < 0) __PYX_ERR(0, 491, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_11kill_conditional_comments, 0, __pyx_n_s_Cleaner_kill_conditional_comment_2, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_kill_conditional_comments, __pyx_t_5) < 0) __PYX_ERR(0, 496, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":502
+ /* "lxml/html/clean.py":507
* etree.Comment)
*
* def _kill_elements(self, doc, condition, iterate=None): # <<<<<<<<<<<<<<
* bad = []
* for el in doc.iter(iterate):
*/
- __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_13_kill_elements, 0, __pyx_n_s_Cleaner__kill_elements, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 502, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_9, __pyx_tuple__38);
- if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_kill_elements, __pyx_t_9) < 0) __PYX_ERR(0, 502, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_13_kill_elements, 0, __pyx_n_s_Cleaner__kill_elements, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 507, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__39);
+ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_kill_elements, __pyx_t_5) < 0) __PYX_ERR(0, 507, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":510
+ /* "lxml/html/clean.py":515
* el.drop_tree()
*
* def _remove_javascript_link(self, link): # <<<<<<<<<<<<<<
* # links like "j a v a s c r i p t:" might be interpreted in IE
* new = _substitute_whitespace('', unquote_plus(link))
*/
- __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_15_remove_javascript_link, 0, __pyx_n_s_Cleaner__remove_javascript_link, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 510, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_remove_javascript_link, __pyx_t_9) < 0) __PYX_ERR(0, 510, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_15_remove_javascript_link, 0, __pyx_n_s_Cleaner__remove_javascript_link, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 515, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_remove_javascript_link, __pyx_t_5) < 0) __PYX_ERR(0, 515, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":518
+ /* "lxml/html/clean.py":523
* return link
*
* _substitute_comments = re.compile(r'/\*.*?\*[inserted by cython to avoid comment closer]/', re.S).sub # <<<<<<<<<<<<<<
*
* def _has_sneaky_javascript(self, style):
*/
- __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 518, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_compile); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 518, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_compile); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 523, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 518, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_S); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 518, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = NULL;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_S); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 523, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = NULL;
__pyx_t_6 = 0;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
- if (likely(__pyx_t_7)) {
+ __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
+ if (likely(__pyx_t_1)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
- __Pyx_INCREF(__pyx_t_7);
+ __Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_8, function);
__pyx_t_6 = 1;
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_8)) {
- PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_s__41, __pyx_t_10};
- __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 518, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_s__42, __pyx_t_11};
+ __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 523, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
- PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_s__41, __pyx_t_10};
- __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 518, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_s__42, __pyx_t_11};
+ __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 523, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
} else
#endif
{
- __pyx_t_11 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 518, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- if (__pyx_t_7) {
- __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); __pyx_t_7 = NULL;
- }
- __Pyx_INCREF(__pyx_kp_s__41);
- __Pyx_GIVEREF(__pyx_kp_s__41);
- PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_6, __pyx_kp_s__41);
- __Pyx_GIVEREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_6, __pyx_t_10);
- __pyx_t_10 = 0;
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 518, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_12 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 523, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_12);
+ if (__pyx_t_1) {
+ __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1); __pyx_t_1 = NULL;
+ }
+ __Pyx_INCREF(__pyx_kp_s__42);
+ __Pyx_GIVEREF(__pyx_kp_s__42);
+ PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_6, __pyx_kp_s__42);
+ __Pyx_GIVEREF(__pyx_t_11);
+ PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_6, __pyx_t_11);
+ __pyx_t_11 = 0;
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 523, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_sub); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 518, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sub); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 523, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_substitute_comments, __pyx_t_8) < 0) __PYX_ERR(0, 518, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_substitute_comments, __pyx_t_8) < 0) __PYX_ERR(0, 523, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- /* "lxml/html/clean.py":520
+ /* "lxml/html/clean.py":525
* _substitute_comments = re.compile(r'/\*.*?\*[inserted by cython to avoid comment closer]/', re.S).sub
*
* def _has_sneaky_javascript(self, style): # <<<<<<<<<<<<<<
* """
* Depending on the browser, stuff like ``e x p r e s s i o n(...)``
*/
- __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_17_has_sneaky_javascript, 0, __pyx_n_s_Cleaner__has_sneaky_javascript, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 520, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_17_has_sneaky_javascript, 0, __pyx_n_s_Cleaner__has_sneaky_javascript, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 525, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_has_sneaky_javascript, __pyx_t_8) < 0) __PYX_ERR(0, 520, __pyx_L1_error)
+ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_has_sneaky_javascript, __pyx_t_8) < 0) __PYX_ERR(0, 525, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- /* "lxml/html/clean.py":544
+ /* "lxml/html/clean.py":552
* return False
*
* def clean_html(self, html): # <<<<<<<<<<<<<<
* result_type = type(html)
* if isinstance(html, basestring):
*/
- __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_19clean_html, 0, __pyx_n_s_Cleaner_clean_html, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 544, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_19clean_html, 0, __pyx_n_s_Cleaner_clean_html, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 552, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_clean_html, __pyx_t_8) < 0) __PYX_ERR(0, 544, __pyx_L1_error)
+ if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_clean_html, __pyx_t_8) < 0) __PYX_ERR(0, 552, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- /* "lxml/html/clean.py":99
+ /* "lxml/html/clean.py":104
*
*
* class Cleaner(object): # <<<<<<<<<<<<<<
* """
* Instances cleans the document of each of the possible offending
*/
- __pyx_t_8 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_n_s_Cleaner, __pyx_tuple__23, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 99, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_n_s_Cleaner, __pyx_tuple__24, __pyx_t_9, NULL, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 104, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_Cleaner, __pyx_t_8) < 0) __PYX_ERR(0, 99, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_Cleaner, __pyx_t_8) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "lxml/html/clean.py":553
+ /* "lxml/html/clean.py":561
* return _transform_result(result_type, doc)
*
* clean = Cleaner() # <<<<<<<<<<<<<<
* clean_html = clean.clean_html
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Cleaner); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 553, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_clean, __pyx_t_1) < 0) __PYX_ERR(0, 553, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Cleaner); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 561, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_9 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 561, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_clean, __pyx_t_9) < 0) __PYX_ERR(0, 561, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- /* "lxml/html/clean.py":554
+ /* "lxml/html/clean.py":562
*
* clean = Cleaner()
* clean_html = clean.clean_html # <<<<<<<<<<<<<<
*
* ############################################################
*/
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_clean); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_clean_html); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 554, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_clean_html, __pyx_t_5) < 0) __PYX_ERR(0, 554, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_clean); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 562, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_clean_html); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 562, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_clean_html, __pyx_t_7) < 0) __PYX_ERR(0, 562, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "lxml/html/clean.py":561
+ /* "lxml/html/clean.py":569
*
* _link_regexes = [
* re.compile(r'(?P<body>https?://(?P<host>[a-z0-9._-]+)(?:/[/\-_.,a-z0-9%&?;=~]*)?(?:\([/\-_.,a-z0-9%&?;=~]*\))?)', re.I), # <<<<<<<<<<<<<<
* # This is conservative, but autolinking can be a bit conservative:
* re.compile(r'mailto:(?P<body>[a-z0-9._-]+@(?P<host>[a-z0-9_.-]+[a-z]))', re.I),
*/
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 561, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_compile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 561, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_I); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 561, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 569, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_compile); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 569, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 569, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_I); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 569, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 561, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 569, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_kp_s_P_body_https_P_host_a_z0_9);
__Pyx_GIVEREF(__pyx_kp_s_P_body_https_P_host_a_z0_9);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_s_P_body_https_P_host_a_z0_9);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_kp_s_P_body_https_P_host_a_z0_9);
__Pyx_GIVEREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8);
__pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 561, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 569, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "lxml/html/clean.py":563
+ /* "lxml/html/clean.py":571
* re.compile(r'(?P<body>https?://(?P<host>[a-z0-9._-]+)(?:/[/\-_.,a-z0-9%&?;=~]*)?(?:\([/\-_.,a-z0-9%&?;=~]*\))?)', re.I),
* # This is conservative, but autolinking can be a bit conservative:
* re.compile(r'mailto:(?P<body>[a-z0-9._-]+@(?P<host>[a-z0-9_.-]+[a-z]))', re.I), # <<<<<<<<<<<<<<
* ]
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 563, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_compile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 563, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 563, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_I); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 563, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 571, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_compile); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 571, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 563, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 571, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_I); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 571, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 571, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_kp_s_mailto_P_body_a_z0_9___P_host_a);
__Pyx_GIVEREF(__pyx_kp_s_mailto_P_body_a_z0_9___P_host_a);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_s_mailto_P_body_a_z0_9___P_host_a);
- __Pyx_GIVEREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_9);
- __pyx_t_9 = 0;
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 563, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_kp_s_mailto_P_body_a_z0_9___P_host_a);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 571, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "lxml/html/clean.py":560
+ /* "lxml/html/clean.py":568
* ############################################################
*
* _link_regexes = [ # <<<<<<<<<<<<<<
* re.compile(r'(?P<body>https?://(?P<host>[a-z0-9._-]+)(?:/[/\-_.,a-z0-9%&?;=~]*)?(?:\([/\-_.,a-z0-9%&?;=~]*\))?)', re.I),
* # This is conservative, but autolinking can be a bit conservative:
*/
- __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 560, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 568, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
__Pyx_GIVEREF(__pyx_t_8);
- PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_9);
- PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_9);
+ PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
__pyx_t_8 = 0;
- __pyx_t_9 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_link_regexes_2, __pyx_t_5) < 0) __PYX_ERR(0, 560, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = 0;
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_link_regexes_2, __pyx_t_7) < 0) __PYX_ERR(0, 568, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "lxml/html/clean.py":566
+ /* "lxml/html/clean.py":574
* ]
*
* _avoid_elements = ['textarea', 'pre', 'code', 'head', 'select', 'a'] # <<<<<<<<<<<<<<
*
* _avoid_hosts = [
*/
- __pyx_t_5 = PyList_New(6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 566, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_7 = PyList_New(6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 574, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_n_s_textarea);
__Pyx_GIVEREF(__pyx_n_s_textarea);
- PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_textarea);
+ PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_textarea);
__Pyx_INCREF(__pyx_n_s_pre);
__Pyx_GIVEREF(__pyx_n_s_pre);
- PyList_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_pre);
+ PyList_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_pre);
__Pyx_INCREF(__pyx_n_s_code);
__Pyx_GIVEREF(__pyx_n_s_code);
- PyList_SET_ITEM(__pyx_t_5, 2, __pyx_n_s_code);
+ PyList_SET_ITEM(__pyx_t_7, 2, __pyx_n_s_code);
__Pyx_INCREF(__pyx_n_s_head);
__Pyx_GIVEREF(__pyx_n_s_head);
- PyList_SET_ITEM(__pyx_t_5, 3, __pyx_n_s_head);
+ PyList_SET_ITEM(__pyx_t_7, 3, __pyx_n_s_head);
__Pyx_INCREF(__pyx_n_s_select);
__Pyx_GIVEREF(__pyx_n_s_select);
- PyList_SET_ITEM(__pyx_t_5, 4, __pyx_n_s_select);
+ PyList_SET_ITEM(__pyx_t_7, 4, __pyx_n_s_select);
__Pyx_INCREF(__pyx_n_s_a);
__Pyx_GIVEREF(__pyx_n_s_a);
- PyList_SET_ITEM(__pyx_t_5, 5, __pyx_n_s_a);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_avoid_elements_2, __pyx_t_5) < 0) __PYX_ERR(0, 566, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ PyList_SET_ITEM(__pyx_t_7, 5, __pyx_n_s_a);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_avoid_elements_2, __pyx_t_7) < 0) __PYX_ERR(0, 574, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "lxml/html/clean.py":569
+ /* "lxml/html/clean.py":577
*
* _avoid_hosts = [
* re.compile(r'^localhost', re.I), # <<<<<<<<<<<<<<
* re.compile(r'\bexample\.(?:com|org|net)$', re.I),
* re.compile(r'^127\.0\.0\.1$'),
*/
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 569, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_compile); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 569, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 569, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 577, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_compile); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 577, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_I); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 569, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 577, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_I); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 577, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 569, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 577, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_kp_s_localhost);
__Pyx_GIVEREF(__pyx_kp_s_localhost);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_s_localhost);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_kp_s_localhost);
__Pyx_GIVEREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8);
__pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 569, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 577, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "lxml/html/clean.py":570
+ /* "lxml/html/clean.py":578
* _avoid_hosts = [
* re.compile(r'^localhost', re.I),
* re.compile(r'\bexample\.(?:com|org|net)$', re.I), # <<<<<<<<<<<<<<
* re.compile(r'^127\.0\.0\.1$'),
* ]
*/
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 570, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 578, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_compile); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 578, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_compile); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 570, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 578, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_I); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 578, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 570, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_I); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 570, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 578, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_kp_s_bexample_com_org_net);
__Pyx_GIVEREF(__pyx_kp_s_bexample_com_org_net);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_s_bexample_com_org_net);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_kp_s_bexample_com_org_net);
+ __Pyx_GIVEREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_9);
+ __pyx_t_9 = 0;
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 578, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "lxml/html/clean.py":571
+ /* "lxml/html/clean.py":579
* re.compile(r'^localhost', re.I),
* re.compile(r'\bexample\.(?:com|org|net)$', re.I),
* re.compile(r'^127\.0\.0\.1$'), # <<<<<<<<<<<<<<
* ]
*
*/
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 571, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 579, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_compile); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 579, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_compile); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 571, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 579, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 571, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- /* "lxml/html/clean.py":568
+ /* "lxml/html/clean.py":576
* _avoid_elements = ['textarea', 'pre', 'code', 'head', 'select', 'a']
*
* _avoid_hosts = [ # <<<<<<<<<<<<<<
* re.compile(r'^localhost', re.I),
* re.compile(r'\bexample\.(?:com|org|net)$', re.I),
*/
- __pyx_t_9 = PyList_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 568, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_5 = PyList_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 576, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_8);
- PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_1);
- PyList_SET_ITEM(__pyx_t_9, 1, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_5);
- PyList_SET_ITEM(__pyx_t_9, 2, __pyx_t_5);
+ PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_8);
+ __Pyx_GIVEREF(__pyx_t_9);
+ PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_9);
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyList_SET_ITEM(__pyx_t_5, 2, __pyx_t_7);
__pyx_t_8 = 0;
- __pyx_t_1 = 0;
- __pyx_t_5 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_avoid_hosts_2, __pyx_t_9) < 0) __PYX_ERR(0, 568, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_9 = 0;
+ __pyx_t_7 = 0;
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_avoid_hosts_2, __pyx_t_5) < 0) __PYX_ERR(0, 576, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":574
+ /* "lxml/html/clean.py":582
* ]
*
* _avoid_classes = ['nolink'] # <<<<<<<<<<<<<<
*
* def autolink(el, link_regexes=_link_regexes,
*/
- __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 574, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 582, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(__pyx_n_s_nolink);
__Pyx_GIVEREF(__pyx_n_s_nolink);
- PyList_SET_ITEM(__pyx_t_9, 0, __pyx_n_s_nolink);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_avoid_classes_2, __pyx_t_9) < 0) __PYX_ERR(0, 574, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_nolink);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_avoid_classes_2, __pyx_t_5) < 0) __PYX_ERR(0, 582, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":576
+ /* "lxml/html/clean.py":584
* _avoid_classes = ['nolink']
*
* def autolink(el, link_regexes=_link_regexes, # <<<<<<<<<<<<<<
* avoid_elements=_avoid_elements,
* avoid_hosts=_avoid_hosts,
*/
- __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_3autolink, 0, __pyx_n_s_autolink, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 576, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- if (!__Pyx_CyFunction_InitDefaults(__pyx_t_9, sizeof(__pyx_defaults), 4)) __PYX_ERR(0, 576, __pyx_L1_error)
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_link_regexes_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 576, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_3autolink, 0, __pyx_n_s_autolink, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 584, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_9)->__pyx_arg_link_regexes = __pyx_t_5;
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
+ if (!__Pyx_CyFunction_InitDefaults(__pyx_t_5, sizeof(__pyx_defaults), 4)) __PYX_ERR(0, 584, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_link_regexes_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 584, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_5)->__pyx_arg_link_regexes = __pyx_t_7;
+ __Pyx_GIVEREF(__pyx_t_7);
+ __pyx_t_7 = 0;
- /* "lxml/html/clean.py":577
+ /* "lxml/html/clean.py":585
*
* def autolink(el, link_regexes=_link_regexes,
* avoid_elements=_avoid_elements, # <<<<<<<<<<<<<<
* avoid_hosts=_avoid_hosts,
* avoid_classes=_avoid_classes):
*/
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_avoid_elements_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 577, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_9)->__pyx_arg_avoid_elements = __pyx_t_5;
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
+ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_avoid_elements_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 585, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_5)->__pyx_arg_avoid_elements = __pyx_t_7;
+ __Pyx_GIVEREF(__pyx_t_7);
+ __pyx_t_7 = 0;
- /* "lxml/html/clean.py":578
+ /* "lxml/html/clean.py":586
* def autolink(el, link_regexes=_link_regexes,
* avoid_elements=_avoid_elements,
* avoid_hosts=_avoid_hosts, # <<<<<<<<<<<<<<
* avoid_classes=_avoid_classes):
* """
*/
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_avoid_hosts_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 578, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_9)->__pyx_arg_avoid_hosts = __pyx_t_5;
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
+ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_avoid_hosts_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 586, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_5)->__pyx_arg_avoid_hosts = __pyx_t_7;
+ __Pyx_GIVEREF(__pyx_t_7);
+ __pyx_t_7 = 0;
- /* "lxml/html/clean.py":579
+ /* "lxml/html/clean.py":587
* avoid_elements=_avoid_elements,
* avoid_hosts=_avoid_hosts,
* avoid_classes=_avoid_classes): # <<<<<<<<<<<<<<
* """
* Turn any URLs into links.
*/
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_avoid_classes_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 579, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_9)->__pyx_arg_avoid_classes = __pyx_t_5;
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_9, __pyx_pf_4lxml_4html_5clean_16__defaults__);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_autolink, __pyx_t_9) < 0) __PYX_ERR(0, 576, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_avoid_classes_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 587, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_5)->__pyx_arg_avoid_classes = __pyx_t_7;
+ __Pyx_GIVEREF(__pyx_t_7);
+ __pyx_t_7 = 0;
+ __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_5, __pyx_pf_4lxml_4html_5clean_16__defaults__);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_autolink, __pyx_t_5) < 0) __PYX_ERR(0, 584, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":621
+ /* "lxml/html/clean.py":629
* el[:0] = pre_children
*
* def _link_text(text, link_regexes, avoid_hosts, factory): # <<<<<<<<<<<<<<
* leading_text = ''
* links = []
*/
- __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_5_link_text, 0, __pyx_n_s_link_text, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 621, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_link_text, __pyx_t_9) < 0) __PYX_ERR(0, 621, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_5_link_text, 0, __pyx_n_s_link_text, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 629, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_link_text, __pyx_t_5) < 0) __PYX_ERR(0, 629, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":679
+ /* "lxml/html/clean.py":687
* return leading_text, links
*
* def autolink_html(html, *args, **kw): # <<<<<<<<<<<<<<
* result_type = type(html)
* if isinstance(html, basestring):
*/
- __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7autolink_html, 0, __pyx_n_s_autolink_html, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 679, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_autolink_html, __pyx_t_9) < 0) __PYX_ERR(0, 679, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7autolink_html, 0, __pyx_n_s_autolink_html, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 687, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_autolink_html, __pyx_t_5) < 0) __PYX_ERR(0, 687, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":688
+ /* "lxml/html/clean.py":696
* return _transform_result(result_type, doc)
*
* autolink_html.__doc__ = autolink.__doc__ # <<<<<<<<<<<<<<
*
* ############################################################
*/
- __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_autolink); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 688, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_doc_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 688, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_autolink); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 696, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_autolink_html); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 688, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- if (__Pyx_PyObject_SetAttrStr(__pyx_t_9, __pyx_n_s_doc_2, __pyx_t_5) < 0) __PYX_ERR(0, 688, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_doc_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 696, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_autolink_html); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 696, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (__Pyx_PyObject_SetAttrStr(__pyx_t_5, __pyx_n_s_doc_2, __pyx_t_7) < 0) __PYX_ERR(0, 696, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- /* "lxml/html/clean.py":694
+ /* "lxml/html/clean.py":702
* ############################################################
*
* _avoid_word_break_elements = ['pre', 'textarea', 'code'] # <<<<<<<<<<<<<<
* _avoid_word_break_classes = ['nobreak']
*
*/
- __pyx_t_9 = PyList_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 694, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_5 = PyList_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 702, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(__pyx_n_s_pre);
__Pyx_GIVEREF(__pyx_n_s_pre);
- PyList_SET_ITEM(__pyx_t_9, 0, __pyx_n_s_pre);
+ PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_pre);
__Pyx_INCREF(__pyx_n_s_textarea);
__Pyx_GIVEREF(__pyx_n_s_textarea);
- PyList_SET_ITEM(__pyx_t_9, 1, __pyx_n_s_textarea);
+ PyList_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_textarea);
__Pyx_INCREF(__pyx_n_s_code);
__Pyx_GIVEREF(__pyx_n_s_code);
- PyList_SET_ITEM(__pyx_t_9, 2, __pyx_n_s_code);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_avoid_word_break_elements, __pyx_t_9) < 0) __PYX_ERR(0, 694, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ PyList_SET_ITEM(__pyx_t_5, 2, __pyx_n_s_code);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_avoid_word_break_elements, __pyx_t_5) < 0) __PYX_ERR(0, 702, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":695
+ /* "lxml/html/clean.py":703
*
* _avoid_word_break_elements = ['pre', 'textarea', 'code']
* _avoid_word_break_classes = ['nobreak'] # <<<<<<<<<<<<<<
*
* def word_break(el, max_width=40,
*/
- __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 695, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 703, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(__pyx_n_s_nobreak);
__Pyx_GIVEREF(__pyx_n_s_nobreak);
- PyList_SET_ITEM(__pyx_t_9, 0, __pyx_n_s_nobreak);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_avoid_word_break_classes, __pyx_t_9) < 0) __PYX_ERR(0, 695, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_nobreak);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_avoid_word_break_classes, __pyx_t_5) < 0) __PYX_ERR(0, 703, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":697
+ /* "lxml/html/clean.py":705
* _avoid_word_break_classes = ['nobreak']
*
* def word_break(el, max_width=40, # <<<<<<<<<<<<<<
* avoid_elements=_avoid_word_break_elements,
* avoid_classes=_avoid_word_break_classes,
*/
- __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_9word_break, 0, __pyx_n_s_word_break, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 697, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- if (!__Pyx_CyFunction_InitDefaults(__pyx_t_9, sizeof(__pyx_defaults1), 3)) __PYX_ERR(0, 697, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_9word_break, 0, __pyx_n_s_word_break, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 705, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (!__Pyx_CyFunction_InitDefaults(__pyx_t_5, sizeof(__pyx_defaults1), 3)) __PYX_ERR(0, 705, __pyx_L1_error)
- /* "lxml/html/clean.py":698
+ /* "lxml/html/clean.py":706
*
* def word_break(el, max_width=40,
* avoid_elements=_avoid_word_break_elements, # <<<<<<<<<<<<<<
* avoid_classes=_avoid_word_break_classes,
* break_character=unichr(0x200b)):
*/
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_avoid_word_break_elements); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 698, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_9)->__pyx_arg_avoid_elements = __pyx_t_5;
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
+ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_avoid_word_break_elements); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 706, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_5)->__pyx_arg_avoid_elements = __pyx_t_7;
+ __Pyx_GIVEREF(__pyx_t_7);
+ __pyx_t_7 = 0;
- /* "lxml/html/clean.py":699
+ /* "lxml/html/clean.py":707
* def word_break(el, max_width=40,
* avoid_elements=_avoid_word_break_elements,
* avoid_classes=_avoid_word_break_classes, # <<<<<<<<<<<<<<
* break_character=unichr(0x200b)):
* """
*/
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_avoid_word_break_classes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 699, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_9)->__pyx_arg_avoid_classes = __pyx_t_5;
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
+ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_avoid_word_break_classes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 707, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_5)->__pyx_arg_avoid_classes = __pyx_t_7;
+ __Pyx_GIVEREF(__pyx_t_7);
+ __pyx_t_7 = 0;
- /* "lxml/html/clean.py":700
+ /* "lxml/html/clean.py":708
* avoid_elements=_avoid_word_break_elements,
* avoid_classes=_avoid_word_break_classes,
* break_character=unichr(0x200b)): # <<<<<<<<<<<<<<
* """
* Breaks any long words found in the body of the text (not attributes).
*/
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_unichr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 700, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 700, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_unichr); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 708, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 708, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_5)->__pyx_arg_break_character = __pyx_t_9;
+ __Pyx_GIVEREF(__pyx_t_9);
+ __pyx_t_9 = 0;
+ __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_5, __pyx_pf_4lxml_4html_5clean_18__defaults__);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_word_break, __pyx_t_5) < 0) __PYX_ERR(0, 705, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_9)->__pyx_arg_break_character = __pyx_t_1;
- __Pyx_GIVEREF(__pyx_t_1);
- __pyx_t_1 = 0;
- __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_9, __pyx_pf_4lxml_4html_5clean_18__defaults__);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_word_break, __pyx_t_9) < 0) __PYX_ERR(0, 697, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- /* "lxml/html/clean.py":738
+ /* "lxml/html/clean.py":746
* child.tail = _break_text(child.tail, max_width, break_character)
*
* def word_break_html(html, *args, **kw): # <<<<<<<<<<<<<<
* result_type = type(html)
* doc = fromstring(html)
*/
- __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_11word_break_html, 0, __pyx_n_s_word_break_html, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 738, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_word_break_html, __pyx_t_9) < 0) __PYX_ERR(0, 738, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_11word_break_html, 0, __pyx_n_s_word_break_html, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 746, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_word_break_html, __pyx_t_5) < 0) __PYX_ERR(0, 746, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":744
+ /* "lxml/html/clean.py":752
* return _transform_result(result_type, doc)
*
* def _break_text(text, max_width, break_character): # <<<<<<<<<<<<<<
* words = text.split()
* for word in words:
*/
- __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_13_break_text, 0, __pyx_n_s_break_text, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 744, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_break_text, __pyx_t_9) < 0) __PYX_ERR(0, 744, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_13_break_text, 0, __pyx_n_s_break_text, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 752, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_break_text, __pyx_t_5) < 0) __PYX_ERR(0, 752, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "lxml/html/clean.py":752
+ /* "lxml/html/clean.py":760
* return text
*
* _break_prefer_re = re.compile(r'[^a-z]', re.I) # <<<<<<<<<<<<<<
*
* def _insert_break(word, width, break_character):
*/
- __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_re); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 752, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_compile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 752, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_re); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 752, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_I); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 752, __pyx_L1_error)
+ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 760, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 752, __pyx_L1_error)
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_compile); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 760, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 760, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_I); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 760, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 760, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(__pyx_kp_s_a_z);
__Pyx_GIVEREF(__pyx_kp_s_a_z);
- PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_kp_s_a_z);
- __Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 752, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_s_a_z);
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7);
+ __pyx_t_7 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 760, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_break_prefer_re, __pyx_t_5) < 0) __PYX_ERR(0, 752, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_break_prefer_re, __pyx_t_7) < 0) __PYX_ERR(0, 760, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "lxml/html/clean.py":754
+ /* "lxml/html/clean.py":762
* _break_prefer_re = re.compile(r'[^a-z]', re.I)
*
* def _insert_break(word, width, break_character): # <<<<<<<<<<<<<<
* orig_word = word
* result = ''
*/
- __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_15_insert_break, 0, __pyx_n_s_insert_break, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__61)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 754, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_insert_break, __pyx_t_5) < 0) __PYX_ERR(0, 754, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_15_insert_break, 0, __pyx_n_s_insert_break, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 762, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_insert_break, __pyx_t_7) < 0) __PYX_ERR(0, 762, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
/* "lxml/html/clean.py":1
* # cython: language_level=3str # <<<<<<<<<<<<<<
*
* """A cleanup tool for HTML.
*/
- __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_5) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_7 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_7) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
/*--- Wrapped vars code ---*/
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
- __Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
+ __Pyx_XDECREF(__pyx_t_12);
if (__pyx_m) {
if (__pyx_d) {
__Pyx_AddTraceback("init lxml.html.clean", __pyx_clineno, __pyx_lineno, __pyx_filename);
Py_CLEAR(__pyx_slice__14);
Py_CLEAR(__pyx_slice__17);
Py_CLEAR(__pyx_tuple__18);
- Py_CLEAR(__pyx_codeobj__19);
- Py_CLEAR(__pyx_tuple__20);
+ Py_CLEAR(__pyx_tuple__19);
+ Py_CLEAR(__pyx_codeobj__20);
Py_CLEAR(__pyx_tuple__21);
Py_CLEAR(__pyx_tuple__22);
Py_CLEAR(__pyx_tuple__23);
Py_CLEAR(__pyx_tuple__24);
- Py_CLEAR(__pyx_codeobj__25);
- Py_CLEAR(__pyx_tuple__26);
- Py_CLEAR(__pyx_codeobj__27);
- Py_CLEAR(__pyx_tuple__28);
- Py_CLEAR(__pyx_codeobj__29);
- Py_CLEAR(__pyx_tuple__30);
- Py_CLEAR(__pyx_codeobj__31);
- Py_CLEAR(__pyx_tuple__32);
- Py_CLEAR(__pyx_codeobj__33);
- Py_CLEAR(__pyx_tuple__34);
- Py_CLEAR(__pyx_codeobj__35);
- Py_CLEAR(__pyx_tuple__36);
- Py_CLEAR(__pyx_codeobj__37);
- Py_CLEAR(__pyx_tuple__38);
+ Py_CLEAR(__pyx_tuple__25);
+ Py_CLEAR(__pyx_codeobj__26);
+ Py_CLEAR(__pyx_tuple__27);
+ Py_CLEAR(__pyx_codeobj__28);
+ Py_CLEAR(__pyx_tuple__29);
+ Py_CLEAR(__pyx_codeobj__30);
+ Py_CLEAR(__pyx_tuple__31);
+ Py_CLEAR(__pyx_codeobj__32);
+ Py_CLEAR(__pyx_tuple__33);
+ Py_CLEAR(__pyx_codeobj__34);
+ Py_CLEAR(__pyx_tuple__35);
+ Py_CLEAR(__pyx_codeobj__36);
+ Py_CLEAR(__pyx_tuple__37);
+ Py_CLEAR(__pyx_codeobj__38);
Py_CLEAR(__pyx_tuple__39);
- Py_CLEAR(__pyx_codeobj__40);
- Py_CLEAR(__pyx_tuple__42);
- Py_CLEAR(__pyx_codeobj__43);
- Py_CLEAR(__pyx_tuple__44);
- Py_CLEAR(__pyx_codeobj__45);
- Py_CLEAR(__pyx_tuple__46);
+ Py_CLEAR(__pyx_tuple__40);
+ Py_CLEAR(__pyx_codeobj__41);
+ Py_CLEAR(__pyx_tuple__43);
+ Py_CLEAR(__pyx_codeobj__44);
+ Py_CLEAR(__pyx_tuple__45);
+ Py_CLEAR(__pyx_codeobj__46);
Py_CLEAR(__pyx_tuple__47);
- Py_CLEAR(__pyx_codeobj__48);
- Py_CLEAR(__pyx_tuple__49);
- Py_CLEAR(__pyx_codeobj__50);
- Py_CLEAR(__pyx_tuple__51);
- Py_CLEAR(__pyx_codeobj__52);
- Py_CLEAR(__pyx_tuple__53);
- Py_CLEAR(__pyx_codeobj__54);
- Py_CLEAR(__pyx_tuple__55);
+ Py_CLEAR(__pyx_tuple__48);
+ Py_CLEAR(__pyx_codeobj__49);
+ Py_CLEAR(__pyx_tuple__50);
+ Py_CLEAR(__pyx_codeobj__51);
+ Py_CLEAR(__pyx_tuple__52);
+ Py_CLEAR(__pyx_codeobj__53);
+ Py_CLEAR(__pyx_tuple__54);
+ Py_CLEAR(__pyx_codeobj__55);
Py_CLEAR(__pyx_tuple__56);
- Py_CLEAR(__pyx_codeobj__57);
- Py_CLEAR(__pyx_tuple__58);
- Py_CLEAR(__pyx_codeobj__59);
- Py_CLEAR(__pyx_tuple__60);
- Py_CLEAR(__pyx_codeobj__61);
+ Py_CLEAR(__pyx_tuple__57);
+ Py_CLEAR(__pyx_codeobj__58);
+ Py_CLEAR(__pyx_tuple__59);
+ Py_CLEAR(__pyx_codeobj__60);
+ Py_CLEAR(__pyx_tuple__61);
+ Py_CLEAR(__pyx_codeobj__62);
/* CodeObjectCache.cleanup */
if (__pyx_code_cache.entries) {
__Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;