Support » Plugin: Mammoth .docx converter » Indented text gone flat after importing

  • Hi,

    When I have an indented text like code snippets like this:

    fruits = ["apple", "banana", "cherry"]
    for x in fruits:
      print(x)

    After importing from Word, it becomes like this:
    fruits = [“apple”, “banana”, “cherry”]
    for x in fruits:
    print(x)

    How to solve this issue?

    Best Regards,

    • This topic was modified 9 months, 1 week ago by macnux.
Viewing 1 replies (of 1 total)
  • Plugin Author Michael Williamson

    (@michaelwilliamson)

    To handle code snippets, you’ll need to use make sure that the code snippet has an appropriate Word style applied, and then use a style mapping to map that Word style to a pre element (or another element that will preserve whitespace with your CSS). For instance:

    p[style-name='Code'] => pre:separator('\\n')
Viewing 1 replies (of 1 total)
  • The topic ‘Indented text gone flat after importing’ is closed to new replies.