[moin-devel] Simple (?) question: wiki mardown to HTML
Paul Boddie
paul at boddie.org.uk
Thu Jul 27 10:11:39 EDT 2017
On Thursday 27. July 2017 14.16.23 Christoph wrote:
>
> Thanks for the hint - I indeed meant markup and not markdown.
No problem! Markdown isn't exactly the most sensible name someone could have
chosen for a text format. ;-)
> Regarding the strip: the sample code that I posted was an interim snapshot
> - the intention was to remove trailing newlines which screwed up
> subsequent code not part of the snippet.
>
> But instead of calling strip() the following works just as well:
>
> for line in f:
> if line [-1] == '\n':
> l0 = line [:-1]
> else:
> l0 = line
> lines.append(l0)
>
>
> Thanks again for your input!
You could use rstrip, potentially with "\r\n" as argument if you don't want to
strip tabs and spaces.
Paul
More information about the moin-devel
mailing list