2

ユーザーが TinyMCE を使用して順序付けられていないリストを入力すると、ソース コードの下で次のようになります。

<ul>
 <li>item 1</li>
 <li>item 2</li>
 <li>item 3</li></ul>

reportlab を使用して PDF にレンダリングすると、次のようにすべて同じ行に箇条書きなしで表示されます。

アイテム 1 アイテム 2 アイテム 3

以下はレポートラボのコードです。

<paraStyle name="long_td_contents_right_notes"
    alignment="right"
    fontName="ACaslon-SemiBold"
    fontSize="8"/>



<blockTable style="blocktablestyle1" colWidths="145,{{if wide}}328{{else}}250{{endif}}">
        {{ for note in notes }}
            <tr><td align="left"><para style="long_td_contents_left">{{ rml(note.title) }}</para></td><td align="left"><para style="long_td_contents_left_notes"> {{ rml(note.body) }}</para></td></tr>
        {{endfor}}

これに関する助けがあれば、大歓迎です。

ありがとう

4

1 に答える 1

0

これはうまくいきました。

{{ for note in notes }}
        {{script}}
                notesWithBullets =  rml( note.body.replace('<li>', '&bull; ').replace('</p>','<br>').replace('</ul>','<br>').replace('</li>', '<br>'))
        {{endscript}}
             <tr><td align="left"><para style="long_td_contents_left">{{ rml(note.title) }}</para></td><td align="left"><para style="long_td_contents_left">{{ rml(notesWithBullets) }}</para></td></tr>
{{endfor}}
于 2015-05-05T19:57:13.540 に答える