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

Fixed missing braces around passed on key values #407

Merged
merged 2 commits into from
Oct 3, 2024

Conversation

muzimuzhi
Copy link
Contributor

The received values of some keys or options may contain unescaped comma (,) and/or equal (=) characters which may break key-value processing, for example breakbefore, breakafter, and break...symbol(pre|post) options.

So in user input, such values need to be enclosed in a pair of braces, e.g., breakafter={,]}. Those braces are then removed in the extracted values (,]). Then to pass on them to other keys/options, the values need to be braced again.

This PR adds the required braces around forwarded key values, and updates breakbefore and breakafter docs to sync with gpoore/fvextra@16de52d (breakbefore and breakafter now support the escaped comma , (closes #15), 2022-11-10).

Example

\documentclass{article}
\usepackage{minted}
\setminted{breakafter={,]}} % ! Package keyval Error: ] undefined.
\setminted{breakafter={,\]}} % ! Missing \endcsname inserted. <to be read again> \protect
\begin{document}
\end{document}
  • Before: error(s) raised.
  • After: no errors.

To sync with fvextra doc starting from v1.5.
gpoore/fvextra@16de52d (breakbefore and breakafter now support the
escaped comma \, (closes issue 15), 2022-11-10)
@muzimuzhi
Copy link
Contributor Author

muzimuzhi commented Oct 2, 2024

To catch all similar cases, I've manually reviewed all uses of = in minted.dtx.

Force pushing rebased commits.

@muzimuzhi muzimuzhi force-pushed the fix/brace-option-values branch from c814bd6 to 706fb12 Compare October 2, 2024 10:19
@gpoore gpoore merged commit 1c68721 into gpoore:main Oct 3, 2024
@muzimuzhi muzimuzhi deleted the fix/brace-option-values branch October 3, 2024 12:07
gpoore added a commit that referenced this pull request Oct 3, 2024
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