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

sourcepos not correct for inline code #503

Open
digitalmoksha opened this issue Dec 10, 2024 · 0 comments
Open

sourcepos not correct for inline code #503

digitalmoksha opened this issue Dec 10, 2024 · 0 comments

Comments

@digitalmoksha
Copy link
Collaborator

It seems that the sourcepos for inline code is slightly off. It doesn't seem to take into account the surrounding backticks.

Case Markdown Sourcemap
Bold
**bold**
<p dir="auto" data-sourcepos="1:1-1:8">
  <strong data-sourcepos="1:1-1:8">bold</strong>
</p>
Italic
_italic_
<p dir="auto" data-sourcepos="1:1-1:8">
  <em data-sourcepos="1:1-1:8">italic</em>
</p>
Code (current)
`code`
<p dir="auto" data-sourcepos="1:1-1:6">
  <code data-sourcepos="1:2-1:5">code</code>
</p>
Code (expected)
`code`
<p dir="auto" data-sourcepos="1:1-1:6">
  <code data-sourcepos="1:1-1:6">code</code>
</p>
Nested backticks (current)
`` `nested backticks` ``
<p dir="auto" data-sourcepos="1:1-1:24">
  <code data-sourcepos="1:3-1:22">`nested backticks`</code>
</p>
Nested backticks (expected)
`` `nested backticks` ``
<p dir="auto" data-sourcepos="1:1-1:24">
  <code data-sourcepos="1:1-1:24">`nested backticks`</code>
</p>

This assumes that the sourcepos of an inline such as strong or emphasis, or inline code, should include the surrounding syntax characters, the backticks in the case of inline code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants