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

HashTag within one-line strings #44

Open
Ecconia opened this issue Jun 23, 2023 · 1 comment
Open

HashTag within one-line strings #44

Ecconia opened this issue Jun 23, 2023 · 1 comment

Comments

@Ecconia
Copy link
Contributor

Ecconia commented Jun 23, 2023

When using SUCC I often stumble across the issue, that it has been a few months and I forgot that one has to escape # inside strings.

Knowledge background:

To my knowledge there are 3 types of strings:

  • One line: <key>: <value>
  • One line quoted: <key>: "<value>"
  • Block:
<key>: """
<value>
"""

All three can be at any point be stopped with # to start a comment. And \# will place a # into the content.

Problem:

I understand that comments can and should be possible/escapable in one-line string values and block-string values.

But they just make no sense in quoted one line string. As after a comment, there is no possible way for the closing " to be added. Hence it is basically destroying the value of the string.
One could argue, that the opening " would be part of the message - but then that should be escaped, else it would be misleading.

Suggestion:

If I am with my understanding correct, and the simple-quoted string is indeed limited to a single line.
Then my proposal is, to ignore # inside of such string (as it makes no sense).

@JimmyCushnie
Copy link
Owner

Hm, this is interesting, thanks for bringing it up. I guess my only concern is that I think # escaping should behave consistently. It feels weird and unintuitive to have different rules for it in different situations.

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

No branches or pull requests

2 participants