Skip to content

Commit

Permalink
fix(rust) escaped double quotes in string (#3904)
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamedAli00949 committed Nov 7, 2023
1 parent fd28298 commit 3270ef9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Core Grammars:

- fix(css) fix overly greedy pseudo class matching [Bradley Mackey][]
- enh(arcade) updated to ArcGIS Arcade version 1.24 [Kristian Ekenes][]
- fix(rust) fix escaped double quotes in string [Mohamed Ali][]
- fix(yaml) fix for yaml with keys having brackets highlighted incorrectly [Aneesh Kulkarni][]
- fix(bash) fix # within token being detected as the start of a comment [Felix Uhl][]

Expand All @@ -15,6 +16,7 @@ Developer Tool:

- enh(tools): order CSS options picklist [David Schach][]

[Mohamed Ali]: https://github.com/MohamedAli00949
[Bradley Mackey]: https://github.com/bradleymackey
[Kristian Ekenes]: https://github.com/ekenes
[Aneesh Kulkarni]: https://github.com/aneesh98
Expand Down
5 changes: 4 additions & 1 deletion src/languages/rust.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,10 @@ export default function(hljs) {
{
className: 'string',
begin: /"/,
end: /"/
end: /"/,
contains: [
hljs.BACKSLASH_ESCAPE
]
}
]
},
Expand Down
2 changes: 2 additions & 0 deletions test/markup/rust/strings.expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@
<span class="hljs-string">br&quot; &quot;</span>;
<span class="hljs-string">br#&quot;hello&quot;#</span>;
<span class="hljs-string">br##&quot;foo&quot;##</span>;

<span class="hljs-meta">#[error(<span class="hljs-string">&quot;\&quot; appears in a string&quot;</span>)]</span>
2 changes: 2 additions & 0 deletions test/markup/rust/strings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ r##" "###
br" ";
br#"hello"#;
br##"foo"##;

#[error("\" appears in a string")]

0 comments on commit 3270ef9

Please sign in to comment.