Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #17158

Re: text to html

From Grant Edwards <invalid@invalid.invalid>
Newsgroups comp.lang.python
Subject Re: text to html
Date 2011-12-13 18:14 +0000
Organization PANIX Public Access Internet and UNIX, NYC
Message-ID <jc84ld$59k$1@reader1.panix.com> (permalink)
References <CAJyBqUfYV9V5eT=0Tf6p41k8Z2Z9VLyCZW=ZB5wyc01_aF9-xA@mail.gmail.com> <mailman.3609.1323797442.27778.python-list@python.org>

Show all headers | View raw


On 2011-12-13, Pedro Henrique Guedes Souto <pedro.h.souto@gmail.com> wrote:
> On Tue, Dec 13, 2011 at 3:22 PM, prakash jp <prakash.stack@gmail.com> wrote:
>
>> Want to publish a log file as a web page, is there a parser to retain
>> the format of the text as is and then convert to html. Please provide
>> the relevant pointers
>
>
> Hey, You can use this:?http://txt2tags.org/

I think thats a bit too likely to interpret stuff in the log messages
as formatting directives.

Two options come to mind:

  1. Don't use HTML.  Return the logfile as-is with Content-Type:
     text/plain.  [That way the user can also save it if needed.]

  2. Escape the file contents using cgi.escape() and then stick the 
     escaped contents inside <pre> </pre> tags.  That's not as nice,
     since saving it is no longer a useful option.


-- 
Grant Edwards               grant.b.edwards        Yow! Now KEN and BARBIE
                                  at               are PERMANENTLY ADDICTED to
                              gmail.com            MIND-ALTERING DRUGS ...

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: text to html Pedro Henrique Guedes Souto <pedro.h.souto@gmail.com> - 2011-12-13 15:30 -0200
  Re: text to html Grant Edwards <invalid@invalid.invalid> - 2011-12-13 18:14 +0000
  Re: text to html James Mills <prologic@shortcircuit.net.au> - 2011-12-14 05:54 -0800

csiph-web