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

Format of code block inside content block #82

Open
8LWXpg opened this issue May 28, 2024 · 4 comments
Open

Format of code block inside content block #82

8LWXpg opened this issue May 28, 2024 · 4 comments

Comments

@8LWXpg
Copy link

8LWXpg commented May 28, 2024

Indent in consecutive code block after [ is doubled

#[#while list.len() > 0 {
    list.pop()
  }\ ]

Desired output

#[#while list.len() > 0 {
  list.pop()
}\ ]

or

#[
  #while list.len() > 0 {
    list.pop()
  }\ 
]
@Enter-tainer
Copy link
Owner

related #21

@Enter-tainer
Copy link
Owner

#23 (comment)

@Enter-tainer
Copy link
Owner

Note: in typst, [something] and [ something ] is different: the second one has extra spaces

@QuadnucYard
Copy link
Collaborator

It is still tricky to decide whether we can add a linebreak in the front of the content block based on context.
For example,

// empty line here

#[foo
bar ]

It involves risks to format as

// empty line here

#[
  foo
  bar
]

although the output is consistent with before.

If we move the content block in this case to another context, we may forget that it is the original context that makes adding a space before foo safe.

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

3 participants