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

[Markdown] Fix backticks and code-spans in table cells #3969

Merged
merged 2 commits into from
Apr 28, 2024

Conversation

deathaxe
Copy link
Collaborator

Fixes #3968

This commit...

  1. removes invalid.deprecated scope from single backticks in table cells
  2. fixes code spans treatment in tables. Codespans require balanced backticks in a single line not containing a | cell separator are found.

Fixes sublimehq#3968

This commit...

1. removes `invalid.deprecated` scope from single backticks in table cells
2. fixes code spans treatment in tables. Codespans require balanced backticks
   in a single line not containing a `|` cell separator are found.
@michaelblyons michaelblyons changed the title [Markdonw] Fix backticks and code-spans in table cells [Markdown] Fix backticks and code-spans in table cells Apr 26, 2024
@deathaxe
Copy link
Collaborator Author

The only downside of current implementation - theoretically - is template syntaxes such as Astro not being able to inject temblate tags into code spans in table cells.

| column 1  | column 2
| ---       | ---
| `{{key}}` | `{{value}}`

Those would currently appear as normal raw text.

@keith-hall
Copy link
Collaborator

keith-hall commented Apr 28, 2024

The only downside of current implementation - theoretically - is template syntaxes such as Astro not being able to inject temblate tags into code spans in table cells.

| column 1  | column 2
| ---       | ---
| `{{key}}` | `{{value}}`

Those would currently appear as normal raw text.

If that will really be a problem then I imagine it could be fixable by having the whole table-cell-code-spans use a lookahead and push into a context. If the lookahead handles the balanced backticks, the inner context can just pop when it sees the closing backticks and consume them all without worrying about how many there are. Edit: but that only works if it's not allowed to have an opening backtick immediately after a closing backtick...

@deathaxe deathaxe merged commit bcc7c6f into sublimehq:master Apr 28, 2024
2 checks passed
@deathaxe deathaxe deleted the pr/markdown/fix-table-code-spans branch April 28, 2024 15:29
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.

[Markdown] Weirdness with whitespace-only inline code in tables
3 participants