Skip to content

fix: preserve empty lines in multi-line strings#32

Merged
attilarepka merged 1 commit intoattilarepka:masterfrom
Jonkimi:develop
Nov 25, 2025
Merged

fix: preserve empty lines in multi-line strings#32
attilarepka merged 1 commit intoattilarepka:masterfrom
Jonkimi:develop

Conversation

@Jonkimi
Copy link
Contributor

@Jonkimi Jonkimi commented Nov 24, 2025

Previously, string_to_table used gmatch("[^\r\n]+") which caused empty lines in multi-line strings (e.g., license text paragraphs) to be swallowed. This resulted in headers being compressed without proper paragraph separation.

This commit:

  • Replaces gmatch with vim.split to correctly preserve empty lines.
  • Handles CRLF normalization.
  • Removes the trailing empty line that typically occurs with Lua multi-line strings.
  • Updates license_spec.lua to expect correct paragraph spacing in generated headers.

Previously, `string_to_table` used `gmatch("[^\r\n]+")` which caused
empty lines in multi-line strings (e.g., license text paragraphs) to be
swallowed. This resulted in headers being compressed without proper
paragraph separation.

This commit:
- Replaces `gmatch` with `vim.split` to correctly preserve empty lines.
- Handles CRLF normalization.
- Removes the trailing empty line that typically occurs with Lua
multi-line strings.
- Updates `license_spec.lua` to expect correct paragraph spacing in
generated headers.
@Jonkimi
Copy link
Contributor Author

Jonkimi commented Nov 24, 2025

fix issue #29

@attilarepka attilarepka merged commit e3c4b44 into attilarepka:master Nov 25, 2025
3 checks passed
@attilarepka
Copy link
Owner

Thanks!

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