View Single Post
Old 12-22-2012, 05:26 AM   #176
AlPe
Digital Amanuensis
AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.
 
AlPe's Avatar
 
Posts: 727
Karma: 1446357
Join Date: Dec 2011
Location: Turin, Italy
Device: Several eReaders and tablets
Hi,

I am not willing to put that "<br/>" in the code, because the content of the input dictionary (Stardict or XML) may or may not have it already.

You should write your own input parser, specific for the input dictionary you want to convert, as explained in Section "Custom parser for the input dictionary" in the page http://www.albertopettarin.it/penelope.html .

Alternatively, you can send me an email with a link to your dictionary, but you will have to wait a couple of days before hearing back.

EDIT: if you want a quick-and-dirty solution, just replace line 572 of penelope.py or line 577 of penelope3.py:
Code:
definition = global_dictionary[k][4]
with:
Code:
definition = global_dictionary[k][4].replace("\n", "<br/>")

Last edited by AlPe; 12-22-2012 at 06:02 AM.
AlPe is offline   Reply With Quote