From: Oleg Broytman Date: Sat, 18 Oct 2003 18:31:05 +0000 (+0000) Subject: BKMK_NSFORMAT. X-Git-Tag: v4.5.3~358 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=fdc0aa93ca48648782725d71c7edbb53c52e081b;p=bookmarks_db.git BKMK_NSFORMAT. git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@18 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23 --- diff --git a/Writers/bkmk_whtml.py b/Writers/bkmk_whtml.py index 54f5c93..918101d 100644 --- a/Writers/bkmk_whtml.py +++ b/Writers/bkmk_whtml.py @@ -5,8 +5,15 @@ """ +import os +NSFORMAT = os.environ.has_key("BKMK_NSFORMAT") + + def dump_comment(comment): - return comment.replace("
", "
\n") + comment = comment.replace("
\n", "\n") + if NSFORMAT: + comment = comment.replace("\n", "
\n") + return comment ind_s = " "*4 @@ -21,10 +28,8 @@ class writer_html(Writer): self.outfile.write(ind_s*level + "

\n") def root_folder(self, f): - header = f.header.replace(".", ".\n") - header = header.replace("\n") - self.outfile.write(header + "\n") + self.outfile.write(f.header + "\n") self.outfile.write('

%s

\n\n' % f.name) self._folder(f, 0) diff --git a/mz2ns b/mz2ns index ea6719c..b962f9a 100755 --- 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/<//g' -e 's/"/"/g' -e 's/&/\&/g' \ bookmarks.html >_tmp.$$ && \