[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lojban] lojban grammer html errors
- To: lojban@yahoogroups.com
- Subject: Re: [lojban] lojban grammer html errors
- From: "Xah Lee" <xah@xahlee.org>
- Date: Thu, 9 Jun 2005 19:20:15 -0600
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
- Delivered-to: mailing list lojban@yahoogroups.com
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=lima; d=yahoogroups.com; b=WB80vosdnrQ7Vn6NK6JeU2tW1rjT/yds3rw8TpLZfV5VrO6nlu08lYQY6W9TVbLI5hT69zoC7MaQIFyaGjiX6EwQhNzDN6i70jKvMmpZdzvp1XDvfVwDvtrZKoAApZIK;
- List-id: <lojban.yahoogroups.com>
- List-unsubscribe: <mailto:lojban-unsubscribe@yahoogroups.com>
- Mailing-list: list lojban@yahoogroups.com; contact lojban-owner@yahoogroups.com
- Sender: nobody <nobody@digitalkingdom.org>
This python script fixes it, except chapter 1 and 14.
But, there are more problems. For example, in chapter 14, many paragraphes don't have
<p></p> tages.
Xah
xah@xahlee.org
â?? http://xahlee.org/
# -*- coding: utf-8 -*-
# Python
import os,sys,shutil
mydir= '/Users/t/web/lojban/hrefgram'
findreplace = [
('</h3>','</a></h3>'),
(u'''
<title>''',
'<title>'),
('''</title>
<link''',
'''</title>
<link'''),
('''
<meta''',
'''<meta'''),
(''' <div class="main" >''',
''),
]
def replaceStringInFile(filePath):
"replaces all findStr by repStr in file filePath"
print filePath
tempName=filePath+'~x~'
backupName=filePath+'~~'
inF = open(filePath,'rb')
s=unicode(inF.read(),'utf-8')
inF.close()
for couple in findreplace:
outtext=s.replace(couple[0],couple[1])
s=outtext
outF = open(tempName,'wb')
outF.write(outtext.encode('utf-8'))
outF.close()
shutil.copy2(filePath,backupName)
os.remove(filePath)
os.rename(tempName,filePath)
def myfun(dummy, dirr, filess):
for child in filess:
if '.html' == os.path.splitext(child)[1] and os.path.isfile(dirr+'/'+child):
replaceStringInFile(dirr+'/'+child)
print child
os.path.walk(mydir, myfun, 'dummy')
--------------------------------------------------
On Jun 9, 2005, at 5:33 PM, Xah Lee wrote:
the lojban ref grammar HTML seems to have some errors.
example:
http://lojban.org/publications/reference_grammar/chapter8.html
CSS Error (24/5): Invalid class selector.
http://lojban.org/publications/reference_grammar/chapter8.html
HTML error (256/62): The end tag </a> is missing.
HTML error (403/64): The end tag </a> is missing.
HTML error (508/53): The end tag </a> is missing.
HTML error (755/72): The end tag </a> is missing.
HTML error (843/76): The end tag </a> is missing.
HTML error (894/69): The end tag </a> is missing.
HTML error (1092/53): The end tag </a> is missing.
HTML error (1201/81): The end tag </a> is missing.
HTML error (1338/73): The end tag </a> is missing.
HTML error (1413/80): The end tag </a> is missing.
HTML error (1457/70): The end tag </a> is missing.
HTML error (1508/7): The end tag </div> is missing.
HTML error (1509/7): The end tag </div> is missing.
(validation report by iCab browser)
replacing every </h3> by </a></h3> seems to fix one type of problem....
Xah
xah@xahlee.org
âË?â?? http://xahlee.org/
â??
------------------------ Yahoo! Groups Sponsor --------------------~-->
In low income neighborhoods, 84% do not own computers.
At Network for Good, help bridge the Digital Divide!
http://us.click.yahoo.com/EA3HyD/3MnJAA/79vVAA/GSaulB/TM
--------------------------------------------------------------------~->
To unsubscribe, send mail to lojban-unsubscribe@onelist.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/lojban/
<*> To unsubscribe from this group, send an email to:
lojban-unsubscribe@yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/