Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tabs Added to Preformatted Text in ODF format #111

Open
Frimkron opened this issue Mar 7, 2012 · 3 comments
Open

Tabs Added to Preformatted Text in ODF format #111

Frimkron opened this issue Mar 7, 2012 · 3 comments

Comments

@Frimkron
Copy link

Frimkron commented Mar 7, 2012

I'm having an issue whereby spaces in my code blocks are being converted to tabs when I convert to odf.

For example, the following diagram:

    +-----+      +-----+
    |  A  | ---> |  B  |
    +-----+      +-----+

Gets converted to the following markup (I've added linebreaks for readability):

<text:p text:style-name="Preformatted Text">
    +-----+<text:tab/>  +-----+<text:line-break/>
    |  A  | ---&gt; |  B  |<text:line-break/>
    +-----+<text:tab/>  +-----+<text:line-break/>
</text:p>

The added <text:tab/> elements cause the preformatted text to look wrong when opened in Open Office, for example.

I'm using multimarkdown version 3.5.1

@fletcher
Copy link
Owner

fletcher commented Mar 7, 2012

That's because tabs get converted to 4 spaces during processing, and this is the only way to get tabs back (e.g. converting 4 spaces back to a tab).

There might be a way to change this behavior inside of code blocks, but this is going to be a really low priority for me.

@Frimkron
Copy link
Author

Frimkron commented Mar 7, 2012

It's probably also worth noting that to properly preserve runs of spaces, they should be encoded as <text:s/> elements, like this:

<text:p text:style-name="Preformatted Text">
    +-----+<text:s text:c="6"/>+-----+<text:line-break/>
    |<text:s text:c="2"/>A<text:s text:c="2"/>| ---&gt; |<text:s text:c="2"/>B<text:s text:c="2"/>|<text:line-break/>
    +-----+<text:s text:c="6"/>+-----+</text:line-break/>
</text:p>

@fletcher
Copy link
Owner

fletcher commented Mar 7, 2012

I'll have to look into that. I'm definitely not an expert in ODF. I'm actually a bit surprised it works as well as it does. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants