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

Escape double quotes in field names when generating XFDF #90

Merged
merged 1 commit into from
Jan 15, 2024

Conversation

ndbroadbent
Copy link
Contributor

@ndbroadbent ndbroadbent commented Dec 5, 2023

We had a strange PDF where some of the form fields contained double quotes in the name. The correct way to escape these in XML is by replacing the double quote characters (") with ". So I extracted the existing code for the value into a new #escape method, and applied the escaping to both the key and the value.

Example form data from one of our PDFs:

                            "L'Investisseur n'est pas un partnership" => nil,
                          "L'investisseur est une telle flow-through" => nil,
                    "d'un \"benefit plan investor\" au sens de 29 US" => nil,
                                      "aucun des cas visés ci-dessus" => nil

Thanks!

@jkraemer jkraemer merged commit 80b8cb0 into jkraemer:master Jan 15, 2024
@jkraemer
Copy link
Owner

thank you!

@ndbroadbent
Copy link
Contributor Author

Hi @jkraemer, thanks for merging the PR! I was wondering if you could please release a new version on Rubygems? Thanks!

@jkraemer
Copy link
Owner

jkraemer commented Jun 18, 2024 via email

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

Successfully merging this pull request may close these issues.

2 participants