Quote:
Originally Posted by davidfor
As mentioned in the other thread, you could do it using a regex function in the editor. A quick and dirty one would be:
Code:
import math
def replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):
boldlen = math.ceil(len(match[0])/2)
boldedword = '<b>' + match[0][:boldlen] + '</b>' + match[0][boldlen:]
return boldedword
With the search as "\b\w+\b", it will make the changes. But, it does not distinguish between words in the text and tags. And doesn't handle if you have already made the changes.
|
I am sorry about that code can't run in my cailbre additional CSS, I don't have program konwlege,think your reply,Can you give me some more code to make sure the additional CSS works on cailbre