View Single Post
Old 12-22-2012, 07:18 AM   #177
xuyn2003
Connoisseur
xuyn2003 might easily be mistaken for a Texanxuyn2003 might easily be mistaken for a Texanxuyn2003 might easily be mistaken for a Texanxuyn2003 might easily be mistaken for a Texanxuyn2003 might easily be mistaken for a Texanxuyn2003 might easily be mistaken for a Texanxuyn2003 might easily be mistaken for a Texanxuyn2003 might easily be mistaken for a Texanxuyn2003 might easily be mistaken for a Texanxuyn2003 might easily be mistaken for a Texanxuyn2003 might easily be mistaken for a Texan
 
Posts: 71
Karma: 18140
Join Date: Jul 2011
Device: PRS-T1&KOBOTOUCH
Smile

Quote:
Originally Posted by AlPe View Post
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/>")
Thanks for your advice!
xuyn2003 is offline   Reply With Quote