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

fixed highlighting inside string interpolations #448

Closed
wants to merge 1 commit into from
Closed

fixed highlighting inside string interpolations #448

wants to merge 1 commit into from

Conversation

florianpircher
Copy link

This line fixes the “highlighting inside string interpolations”-issues. The following code will be highlighted correctly using prism.

let age = 42
let str = "\(age) years old"

This line fixes the “highlighting inside string interpolations”-issues. The following code will be highlighted correctly using prism.

```swift
let age = 42
let str = "\(age) years old"
```
@LeaVerou
Copy link
Member

Could you include an example of what you mean by “correctly”? Thanks for working on this!

@florianpircher
Copy link
Author

bildschirmfoto 2014-12-31 um 12 45 12

In the second <pre>-tag the Swift code gets wrapped by the string. This pull request fixes this incorrect behavior (first <pre>-tag).

@LeaVerou
Copy link
Member

So you fix this by terminating the string where the parentheses start/end? That doesn’t seem correct.
It would be better to add a token inside the string (see the API docs about this) with the name variable.
This way people will also be able to use selectors like .string .variable to highlight interpolated variables differently. :)

@Golmote Golmote closed this in 89cd5d0 Sep 5, 2015
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