def textblob_to_html(render_string, blob, a_data) : do_query = make_query_maker(render_string, blob) action_assert(blob["doc"]["type"] == "text") tags, tag_data, html = markup.parse_markup(blob["doc"]["text_content"], { "blobbase" : blob["doc"]["blob_base"], "query" : do_query, }) a_data["content"] = a_data.get("content", "") + \ markup.parse_tags(format_tag_value, blob, *tag_data)+html raise DeferAction()
def get_prepared_tags_for_db(text) : tags, tag_data, html = markup.parse_markup(text, {"blobbase" : ""}) new_tags = dict() for key,values in tags.iteritems() : if type(values) == list : #new_tags[key] = [value.lower() for value in values] new_tags[key] = [value for value in values] else : #new_tags[key] = values.lower() new_tags[key] = values return new_tags