|
|
@ -196,17 +196,33 @@ def new_publish(): |
|
|
|
flag, data = get_qwik_service(variant, language) |
|
|
|
CLEANR = re.compile('<.*?>') |
|
|
|
CLEANR_back_slash = re.compile("\"") |
|
|
|
ul_html='<ul style="list-style-type: none; padding-left: 0px;"> <span style="width: 0;height: 0;border-top: 9px solid transparent;border-left: 12px solid red;border-bottom: 9px solid transparent;position: absolute;"></span>' |
|
|
|
li_html='<li style="margin-left: 25px;padding: 0px 1px 5px 0px;"data-list=\"bullet\">' |
|
|
|
cling_li='</li><span style="width: 0;height: 0;border-top: 9px solid transparent;border-left: 12px solid red;border-bottom: 9px solid transparent;position: absolute;"></span>' |
|
|
|
ul_html='<ul style="list-style-type: none; padding-left: 0px;"><span style="width: 0;height: 0;border-top: 6px solid transparent;border-left: 8px solid red;border-bottom: 6px solid transparent;position: absolute;margin-top: 3px;"></span>' |
|
|
|
li_html='<li style="margin-left: 15px;padding: 0px 1px 5px 0px;"data-list=\"bullet\">' |
|
|
|
cling_li='</li><span style="width: 0;height: 0;border-top: 6px solid transparent;border-left: 8px solid red;border-bottom: 6px solid transparent;position: absolute;margin-top: 3px;"></span>' |
|
|
|
cling_last='</ul>' |
|
|
|
find_last_ul='<span style="width: 0;height: 0;border-top: 9px solid transparent;border-left: 12px solid red;border-bottom: 9px solid transparent;position: absolute;"></span></ul>' |
|
|
|
find_last_ul='<span style="width: 0;height: 0;border-top: 6px solid transparent;border-left: 8px solid red;border-bottom: 6px solid transparent;position: absolute;margin-top: 3px;"></span></ul>' |
|
|
|
|
|
|
|
for dt in data: |
|
|
|
if len(dt['consumables'])>0: |
|
|
|
for con in dt['consumables']: |
|
|
|
if con['content']: |
|
|
|
con['content'] = re.sub(CLEANR, '', con['content']) |
|
|
|
if len(dt['pre_work'])>0: |
|
|
|
for pw in dt['pre_work']: |
|
|
|
reg_str = "<p>" |
|
|
|
res = re.findall(reg_str, pw['content']) |
|
|
|
if res: |
|
|
|
pw['content'] = re.sub('<p>','<p style="color: #fff">',pw['content'] ) |
|
|
|
else: |
|
|
|
pw['content'] = '<p style="color: #fff">'+pw['content']+'</p>' |
|
|
|
# VALID_TAGS = ['div', 'p'] |
|
|
|
# soup = BeautifulSoup(pw['content']) |
|
|
|
# for tag in soup.findAll('p'): |
|
|
|
# if tag.name in VALID_TAGS: |
|
|
|
# pw['content'] = re.sub('<p>','<p style="color: #fff">',pw['content'] ) |
|
|
|
# else: |
|
|
|
# pw['content'] = '<p style="color: #fff">'+pw['content']+'</p>' |
|
|
|
|
|
|
|
if dt['qwik_procedure']: |
|
|
|
for qp in dt['qwik_procedure']['LHS']: |
|
|
|
if qp['content']: |
|
|
|