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

When referencing a label, I want to indicate the end with a ;. #4172

Open
iwkjosec opened this issue May 17, 2024 · 5 comments
Open

When referencing a label, I want to indicate the end with a ;. #4172

iwkjosec opened this issue May 17, 2024 · 5 comments
Labels
feature request New feature or request syntax About syntax, parsing, etc.

Comments

@iwkjosec
Copy link

Description

In the current Typst syntax, writing a@lb references <lb>, but if I want to reference <l>, writing a@l b results in an unwanted space between l and b instead of referencing <l>.
I find it strange that, while in code starting with #, we can avoid spaces by indicating the end with a ;, we cannot do the same with labels.

Use Case

As per the Title

@iwkjosec iwkjosec added the feature request New feature or request label May 17, 2024
@laurmaedje
Copy link
Member

We can look into allowing that. In the meantime, you can write a#[@l]b.

@laurmaedje laurmaedje added the syntax About syntax, parsing, etc. label May 17, 2024
@Enivex
Copy link
Collaborator

Enivex commented May 17, 2024

We can look into allowing that. In the meantime, you can write a#[@l]b.

I'd caution against allowing ; for this purpose. It's not uncommon that you want to use an actual semicolon after a reference, and with this change you would be forced to escape it.

@Enivex
Copy link
Collaborator

Enivex commented May 17, 2024

I'd prefer the proposed syntax (that you didn't like) here #3010 over this

@laurmaedje
Copy link
Member

I'd caution against allowing ; for this purpose. It's not uncommon that you want to use an actual semicolon after a reference, and with this change you would be forced to escape it.

Ah right, I knew there was something ... but couldn't remember.

@iwkjosec
Copy link
Author

The notation that surrounds the beginning and end with parentheses is cumbersome. When you realize that you need to indicate the end of a label after writing @label_name, you have to go back to the position of the @ to insert the opening parenthesis.
In my experience, I have never thought of writing actual ; after a label reference.
I don't think there are many cases where one would want to write ; immediately after referencing a label. Why should we be concerned only with ; immediately after a label reference when characters like * and _ need to be escaped even when they are not immediately following a code or label reference?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request syntax About syntax, parsing, etc.
Projects
None yet
Development

No branches or pull requests

3 participants