(?:(?!<).)*)<\/a>')
link_data = link_re.findall(data)
for i in link_data:
data = link_re.sub('' + i + '', data, 1)
return data
def render_do(title, data, num, include):
# num == 1 -> commit O | html
# num == 2 -> commit X | list
# num == 3 -> commit X
curs.execute(db_change('select data from other where name = "markup"'))
rep_data = curs.fetchall()
if rep_data[0][0] == 'namumark':
data = namumark(conn, data, title, include)
elif rep_data[0][0] == 'custom':
data = custom_mark(conn, data, title, include)
elif rep_data[0][0] == 'js_onmark':
include = (include + '_') if include else ''
data = [
'' + html.escape(data) + '
',
'''
do_onmark_render(
test_mode = 0,
name_id = "''' + include + '''render_content",
name_include = "''' + include + '''",
name_doc = "''' + title.replace('"', '//"') + '''",
);
''',
[]
]
else:
data = [data, '', []]
if num in [1, 3]:
if data[2] == []:
curs.execute(db_change("insert into back (title, link, type) values ('test', ?, 'nothing')"), [title])
else:
curs.executemany(db_change("insert into back (link, title, type) values (?, ?, ?)"), data[2])
curs.execute(db_change("delete from back where title = ? and type = 'no'"), [title])
if num != 3:
conn.commit()
if num == 2:
return [data[0], data[1]]
else:
return data[0] + ''