plone / blocks-conversion-tool

A tool to convert HTML (as used in Plone Classic) to Blocks (as used on Volto)
7 stars 5 forks source link

Text without enclosing html-tag will be dropped #16

Closed pbauer closed 1 year ago

pbauer commented 1 year ago

Text like this (from plone.org):

'Meeting time: <a href="http://www.timeanddate.com/worldclock/fixedtime.html?month=12&amp;day=3&amp;year=2004&amp;hour=11&amp;min=0&amp;sec=0&amp;p1=207">11 AM EST</a>\r\n\r\nAgenda Items\r\n\r\n  1) Approve <a href="/foundation/meetings/board/20041119"> minutes \r\n  from previous meeting</a>.\r\n\r\n  2) Approve agenda.\r\n\r\n  3) Officer reports.\r\n\r\n  4) Committee reports (below).\r\n\r\n  5) Old business (below).\r\n\r\n  6) New business (below).\r\n\r\n  7) Review newly-discussed action items.\r\n\r\n  8) Set time for next meeting.\r\n\r\nCommittee Reports\r\n\r\n  Membership Committee\r\n\r\n  IP Committee\r\n\r\n  Trademark Committee\r\n\r\n  Marketing Committee\r\n\r\n  Fundraising Committee\r\n  \r\n\r\nOld Business\r\n\r\n  1) Joel will conduct follow-up open door session on IRC about conservancy\r\n\r\n  2) Geoff will configure J2 voice mail forwarding to be sent to Geoff, Joel, Paul. [DONE]\r\n\r\n  3) Geoff will put together a contributor recognition committee \r\n\r\nNew Business\r\n\r\n  1) [Paul\'s conservancy issues here]'

The result:

{'444df18d-5979-4bad-afa8-0b276fa1bcb1': {'@type': 'slate', 'value': [{'type': 'link', 'data': {'url': 'http://www.timeanddate.com/worldclock/fixedtime.html?month=12&day=3&year=2004&hour=11&min=0&sec=0&p1=207', 'title': None, 'target': None}, 'children': [{'text': '11 AM EST'}]}], 'plaintext': '11 AM EST'}, 'c162056f-29ef-4766-8c35-3fc865dc88de': {'@type': 'slate', 'value': [{'type': 'link', 'data': {'url': '/foundation/meetings/board/20041119', 'title': None, 'target': None}, 'children': [{'text': ' minutes    from previous meeting'}]}], 'plaintext': ' minutes \n  from previous meeting'}}

All text without a enclosing html-tag will be dropped.