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

Add link and quote queries for markdown #1296

Merged
merged 1 commit into from
Dec 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions book/src/themes.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ We use a similar set of scopes as

- `type` - Types
- `builtin` - Primitive types provided by the language (`int`, `usize`)
- `constructor`

- `constant` (TODO: constant.other.placeholder for %v)
- `builtin` Special constants provided by the language (`true`, `false`, `nil` etc)
Expand Down Expand Up @@ -169,8 +170,9 @@ We use a similar set of scopes as
- `numbered`
- `bold`
- `italic`
- `underline`
- `link`
- `link`
- `url`
- `label`
- `quote`
- `raw`
- `inline`
Expand Down
2 changes: 1 addition & 1 deletion runtime/queries/latex/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@
((generic_command
name:(generic_command_name) @_name
.
arg: (_) @markup.underline.link)
arg: (_) @markup.link.url)
(#match? @_name "^(\\\\url|\\\\href)$"))

(ERROR) @error
Expand Down
7 changes: 4 additions & 3 deletions runtime/queries/markdown/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@
(fenced_code_block)
] @markup.raw.block

(block_quote) @markup.quote

(code_span) @markup.raw.inline

(emphasis) @markup.italic

(strong_emphasis) @markup.bold

(link_destination) @markup.underline.link
sudormrfbin marked this conversation as resolved.
Show resolved Hide resolved

; (link_label) @markup.label ; TODO: rename
(link_destination) @markup.link.url
(link_label) @markup.link.label

[
(list_marker_plus)
Expand Down
4 changes: 2 additions & 2 deletions runtime/queries/svelte/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
((element (start_tag (tag_name) @_tag) (text) @markup.inline)
(#match? @_tag "^(code|kbd)$"))

((element (start_tag (tag_name) @_tag) (text) @markup.underline.link)
((element (start_tag (tag_name) @_tag) (text) @markup.link.url)
(#eq? @_tag "a"))

((attribute
(attribute_name) @_attr
(quoted_attribute_value (attribute_value) @markup.underline.link))
(quoted_attribute_value (attribute_value) @markup.link.url))
(#match? @_attr "^(href|src)$"))

(tag_name) @tag
Expand Down
2 changes: 1 addition & 1 deletion theme.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ label = "honey"
"markup.heading" = "lilac"
"markup.bold" = { modifiers = ["bold"] }
"markup.italic" = { modifiers = ["italic"] }
"markup.underline.link" = { fg = "silver", modifiers = ["underlined"] }
"markup.link.url" = { fg = "silver", modifiers = ["underlined"] }
"markup.raw" = "almond"

# TODO: diferentiate doc comment
Expand Down