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

Initial space after a delimiter it is ignored #162

Open
fvollmer opened this issue Sep 28, 2020 · 2 comments
Open

Initial space after a delimiter it is ignored #162

fvollmer opened this issue Sep 28, 2020 · 2 comments

Comments

@fvollmer
Copy link

fvollmer commented Sep 28, 2020

Initial space after a delimiter it is ignored.

Example

csv:

foo,bar
hello, and some more text

text:

This is some text%VAR_bar%.

This should be transformed into

This is some text and some more text.

but instead is transformed into

This is some textand some more text.

Workaround

Use quotes in csv (but not all tools support this)
csv:

foo,bar
hello," and some more text"

Fix

Set skipinitialspace=False in https://github.com/berteh/ScribusGenerator/blob/master/ScribusGeneratorBackend.py#L559

I'm not sure why it was set to True. Is there any reason? If not I'm more than happy to provide a PR 😁

PS: Thanks for your nice script!

@fvollmer
Copy link
Author

fvollmer commented Sep 29, 2020

Seems like skipinitialspace=True was introduced by ec03050.

Is skipinitialspace=True really necessary to support escaping quotes in data using double: ""?

@berteh
Copy link
Owner

berteh commented Mar 7, 2021

Thanks @fvollmer for your issue report and sorry for my late answer. No indeed I don't see why the skipinitialspace should be put to True by default... even if it sounded like a good idea at the time. fee free to put a PR to correct this. thanks !

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