]> git.phdru.name Git - bookmarks_db.git/commitdiff
BKMK_NSFORMAT.
authorOleg Broytman <phd@phdru.name>
Sat, 18 Oct 2003 18:31:05 +0000 (18:31 +0000)
committerOleg Broytman <phd@phdru.name>
Sat, 18 Oct 2003 18:31:05 +0000 (18:31 +0000)
git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@18 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23

Writers/bkmk_whtml.py
mz2ns

index 54f5c93e3ba689c5acbca555fe4e603a5c6266a8..918101d155a4dbbe828c352b9e697bbe6aeb4616 100644 (file)
@@ -5,8 +5,15 @@
 """
 
 
+import os
+NSFORMAT = os.environ.has_key("BKMK_NSFORMAT")
+
+
 def dump_comment(comment):
-   return comment.replace("<BR>", "<BR>\n")
+   comment = comment.replace("<BR>\n", "\n")
+   if NSFORMAT:
+      comment = comment.replace("\n", "<BR>\n")
+   return comment
 
 
 ind_s = " "*4
@@ -21,10 +28,8 @@ class writer_html(Writer):
       self.outfile.write(ind_s*level + "<DL><p>\n")
 
    def root_folder(self, f):
-      header = f.header.replace(".", ".\n")
-      header = header.replace("<T", "\n<T", 3)
       self.outfile.write("<!DOCTYPE NETSCAPE-Bookmark-file-1>\n")
-      self.outfile.write(header + "\n")
+      self.outfile.write(f.header + "\n")
       self.outfile.write('<H1>%s</H1>\n\n' % f.name)
       self._folder(f, 0)
 
diff --git a/mz2ns b/mz2ns
index ea6719ce1f26a1a1e9f04aab27504d2dca5d6239..b962f9a4eaf8e4a14bf1db999f8490b70469ca72 100755 (executable)
--- a/mz2ns
+++ b/mz2ns
@@ -3,7 +3,7 @@
 PATH=$HOME/lib/bookmarks_db:$PATH
 
 bkmk2db || exit 1
-db2bkmk.py || exit 2
+BKMK_NSFORMAT=TRUE db2bkmk.py || exit 2
 
 sed -e 's/&lt;/</g' -e 's/&gt;/>/g' -e 's/&quot;/"/g' -e 's/&amp;/\&/g' \
    bookmarks.html >_tmp.$$ && \