View Single Post
Old 01-17-2017, 06:46 PM   #87
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
@st_albert...My grateful thanks for confirming that the plugin works on Linux.

I also had a re-think about your <i> <b> <u> question. You could certainly do it with S&R as you suggest. But it would also be very easy for me to change my plugin to to get rid of these <b> <i> and <u> tags and replace all of them with their <span> equivalents in the html file.

Here's a code example of how to do it using bs4

Spoiler:
Code:
html = BeautifulSoup('html_file_text', 'html.parser')

search_tags = ['i', 'b', 'u']
for tag in html.findAll(search_tags)
   if tag.name ='b':                     
       tag.name  = 'span'
       tag.span['style'] = 'font-weight: bold;'
    
   if tag.name = 'i':
       tag.name  = 'span'
       tag.span['style'] = 'font-style: italic;'
    
   if tag.name = 'u':
       tag.name  = 'span'
       tag.span['style'] = 'text-decoration: underline;'
slowsmile is offline   Reply With Quote