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

Broken escaping in templating export #3381

Closed
wetneb opened this issue Dec 3, 2020 · 1 comment · Fixed by #4355
Closed

Broken escaping in templating export #3381

wetneb opened this issue Dec 3, 2020 · 1 comment · Fixed by #4355
Labels
export: template About the custom templating exporter Type: Bug Issues related to software defects or unexpected behavior, which require resolution.
Milestone

Comments

@wetneb
Copy link
Member

wetneb commented Dec 3, 2020

Curly braces are used in the templating exporter to delimit expressions from the rest of the template text. Therefore if we want to use curly braces in the expressions they need to be escaped. According to the code, we are supposed to do this with \{, but that does not actually work.

To Reproduce

Steps to reproduce the behavior:

  1. First, open any project
  2. Then, open the templating export dialog
  3. Finally, input the following template:
{{"\}\}"}}

This is supposed to evaluate to just }} for each row.

Current Results

We get {{"\}\}"}} instead.

Expected Behavior

We should get }}

Versions

  • Operating System: Linux
  • Browser Version: irrelevant
  • JRE or JDK Version: 11
  • OpenRefine: 3.4.1

Additional context

Brought up while trying to document the templating exporter.

@wetneb wetneb added Type: Bug Issues related to software defects or unexpected behavior, which require resolution. export: template About the custom templating exporter labels Dec 3, 2020
@allanaaa
Copy link
Contributor

allanaaa commented Dec 3, 2020

Warpeas added a commit to Warpeas/OpenRefine that referenced this issue May 22, 2021
wetneb added a commit that referenced this issue Feb 3, 2022
Closes #3381

Added a parsing exception to the findEndBrace() method in case an end brace cannot be found.

Co-authored-by: jinouy2 <68868840+jinouy2@users.noreply.github.com>
Co-authored-by: Antonin Delpeuch <antonin@delpeuch.eu>
@wetneb wetneb added this to the 3.6 milestone Feb 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
export: template About the custom templating exporter Type: Bug Issues related to software defects or unexpected behavior, which require resolution.
Projects
None yet
2 participants