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 page titles in stork TOML file #15

Merged
merged 1 commit into from
Feb 3, 2023

Conversation

s3lph
Copy link
Contributor

@s3lph s3lph commented Nov 8, 2022

Pull Request Checklist

Resolves: #3 (comment)

  • Conformed to code style guidelines by running appropriate linting tools
  • Updated documentation for changed code

Description

If a page title contains a double quote ("), the double quote is rendered into the stork toml file verbatim, creating a syntax error and causing stork to fail.

This PR escapes double quotes in titles (AFAICT this is the only place where they should appear) with \", fixing the syntax errors.

@arbinada-com
Copy link

This is a blocking bug that requires a user to modify plugin source code. Please merge it ASAP.

Copy link
Contributor

@justinmayer justinmayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix, Sebastian!

@justinmayer justinmayer merged commit e292e0c into pelican-plugins:main Feb 3, 2023
@maphew maphew mentioned this pull request Feb 4, 2023
2 tasks
maphew added a commit to maphew/search that referenced this pull request Feb 4, 2023
This should handle any arbitrary punctuation marks which may happen to
be in the Title - `",',\,*,...etc`.

I don't undersand why this works, since we're not doing anything with 
json. I just know that everything I've thrown at it comes out safely.

I left the change from pelican-plugins#15 intact, though json.dumps makes it 
unnecessary.
justinmayer pushed a commit that referenced this pull request Feb 9, 2023
This should handle any arbitrary punctuation marks which may happen to
be in the Title - `",',\,*,...etc`.

I don't undersand why this works, since we're not doing anything with
JSON. I just know that everything I've thrown at it comes out safely.

The change from #15 performed manual title cleaning of nested quotes
but did not address other potentially-problematic characters in the
title, and json.dumps makes that change unnecessary and moot.

Moreover, processing `title` with the manual quote handling AND using
json.dumps together results in double-escaping of quotes. Ergo, that
manual quotation-mark handling code has been removed here.
@justinmayer
Copy link
Contributor

This change was superseded by #23 and released in v1.0.2. That said, thanks again for the fix, Sebastian!

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.

expected newline, found an identifier
3 participants