Bug fix: Don't let mispeller screw up <c> tags. Fixes #5
This commit is contained in:
parent
2b9278d717
commit
109ec04422
2 changed files with 12 additions and 1 deletions
|
@ -37,6 +37,7 @@ CHANGELOG
|
||||||
* Openning global userlist doesn't reset OP status of memo users - Kiooeht [evacipatedBox]
|
* Openning global userlist doesn't reset OP status of memo users - Kiooeht [evacipatedBox]
|
||||||
* Alt characters don't break on random replace - Kiooeht [evacipatedBox]
|
* Alt characters don't break on random replace - Kiooeht [evacipatedBox]
|
||||||
* Trollian 2.5 tray icon is now Trollian icon - Kiooeht [evacipatedBox]
|
* Trollian 2.5 tray icon is now Trollian icon - Kiooeht [evacipatedBox]
|
||||||
|
* Don't screw up <c> tags with the mispeller - Kiooeht [evacipatedBox]
|
||||||
* Mac Bug fixes
|
* Mac Bug fixes
|
||||||
* Create all datadir stuff - Lexi [lexicalNuance]
|
* Create all datadir stuff - Lexi [lexicalNuance]
|
||||||
|
|
||||||
|
|
12
dataobjs.py
12
dataobjs.py
|
@ -90,10 +90,20 @@ class pesterQuirk(object):
|
||||||
percentage = self.quirk["percentage"]/100.0
|
percentage = self.quirk["percentage"]/100.0
|
||||||
words = string.split(" ")
|
words = string.split(" ")
|
||||||
newl = []
|
newl = []
|
||||||
|
ctag = re.compile("(</?c=?.*?>)", re.I)
|
||||||
for w in words:
|
for w in words:
|
||||||
p = random.random()
|
p = random.random()
|
||||||
if p < percentage:
|
if not ctag.search(w) and p < percentage:
|
||||||
newl.append(mispeller(w))
|
newl.append(mispeller(w))
|
||||||
|
elif p < percentage:
|
||||||
|
split = ctag.split(w)
|
||||||
|
tmp = []
|
||||||
|
for s in split:
|
||||||
|
if s and not ctag.search(s):
|
||||||
|
tmp.append(mispeller(s))
|
||||||
|
else:
|
||||||
|
tmp.append(s)
|
||||||
|
newl.append("".join(tmp))
|
||||||
else:
|
else:
|
||||||
newl.append(w)
|
newl.append(w)
|
||||||
return " ".join(newl)
|
return " ".join(newl)
|
||||||
|
|
Loading…
Reference in a new issue