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

Fix panic for Ruby files with unindented heredocs #929

Merged
merged 3 commits into from
Apr 21, 2020
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

- Performance problems with C# source code have been fixed, see #677 (@keith-hall)
- Performance problems with Makefiles have been fixed, see #750 (@keith-hall)
- Fig bux when highlighting Ruby files with unindented heredocs, see #914 (@keith-hall)

## Other

Expand Down
135 changes: 64 additions & 71 deletions Cargo.lock

Large diffs are not rendered by default.

Binary file modified assets/syntaxes.bin
Binary file not shown.
3 changes: 3 additions & 0 deletions tests/examples/regression_tests/issue_190.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```javascript
var test = "boom";
```
4 changes: 4 additions & 0 deletions tests/examples/regression_tests/issue_28.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Test

<div>
</div>
4 changes: 4 additions & 0 deletions tests/examples/regression_tests/issue_314.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module Main where

main :: IO ()
main = putStrLn "Please show my file :c"
3 changes: 3 additions & 0 deletions tests/examples/regression_tests/issue_914.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<<END_DESC
Test
END_DESC
2 changes: 2 additions & 0 deletions tests/examples/regression_tests/issue_915.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<style lang="stylus">
</style>
17 changes: 17 additions & 0 deletions tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -627,3 +627,20 @@ fn filename_multiple_err() {
.assert()
.failure();
}

#[test]
fn do_not_panic_regression_tests() {
for filename in &[
"issue_28.md",
"issue_190.md",
"issue_314.hs",
"issue_914.rb",
"issue_915.vue",
] {
bat()
.arg("--color=always")
.arg(&format!("regression_tests/{}", filename))
.assert()
.success();
}
}