Skip to content

Conversation

@JuroOravec
Copy link
Contributor

@JuroOravec JuroOravec commented Jan 25, 2026

Part of django-components/django-components#1255.

The legacy tag parser wasn't handling newlines inside strings properly. I fixed it by wrapping the content in triple quotes """ and escaping " -> \". So that the entire string can be kept as is, but still handle newlines.

While at it I also:

  • updated the project to use uv instead of requirements.txt
  • dropped support for py 3.8 and py 3.9

"template_string(context, source, {}, filters, tags, {})",
token_tuple, value.value.content
)),
ValueKind::Variable => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here we wrap those values in triple quotes ot safely handle newlines.

I ahve already implemneted this in Citry before, but turns out I forgot to add it here.

@JuroOravec JuroOravec merged commit 4981957 into main Jan 25, 2026
10 checks passed
@JuroOravec JuroOravec deleted the jo-fix-multiline-string branch January 25, 2026 16:38
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