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

Link and mark annotations on the same line #385

Open
pomber opened this issue Jun 15, 2023 · 2 comments
Open

Link and mark annotations on the same line #385

pomber opened this issue Jun 15, 2023 · 2 comments

Comments

@pomber
Copy link
Contributor

pomber commented Jun 15, 2023

Here, the link annotation is applied to the wrong part of the line

```python mark=1[7:13]
# link[2:5] #foo
print("This is Code Hike")
```

Playground

@knie20
Copy link

knie20 commented Aug 9, 2023

did some debugging on this. Narrowed the bug down to \packages\mdx\src\smooth-code\splitter.tsx > getTokenGroups function. The groups returned have faulty tokens with them.

@knie20
Copy link

knie20 commented Aug 16, 2023

update.

I missed the mark the first go. The real culprit is the annotateLineTokenGroups in annotations.tsx It's a huge function that I don't fully understand yet, but it "binds" the CodeLink Component in this example to the third "group" instead of the first.

image
in this image, the annotation should be in the first element in annotatedGroups, but is in the last for some reason.

PS I couldn't get the tsx mappings to work properly on the debugger for this one. Not sure if this is a next thing or tsx thing. I debugged with no mappings.

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