diff --git a/Changelog.md b/Changelog.md index f0a460272c..6f11bd52ca 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,11 @@ # Changelog +## [v2.5.1] + +### 🐛 Bug fixes + +- Fix bug in syntax highlighting caused by incorrect function call (#7187) + ## [v2.5.0] ### ✨ New features and improvements diff --git a/Gemfile.lock b/Gemfile.lock index 59a9f66a1b..af1e64f195 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -128,7 +128,7 @@ GEM combine_pdf (1.0.26) matrix ruby-rc4 (>= 0.1.5) - concurrent-ruby (1.3.3) + concurrent-ruby (1.3.4) config (5.5.1) deep_merge (~> 1.2, >= 1.2.1) connection_pool (2.4.1) @@ -183,7 +183,7 @@ GEM dry-schema (>= 1.12, < 2) zeitwerk (~> 2.6) erubi (1.13.0) - et-orbi (1.2.7) + et-orbi (1.2.11) tzinfo exception_notification (4.5.0) actionmailer (>= 5.2, < 8) @@ -197,8 +197,8 @@ GEM faker (3.4.2) i18n (>= 1.8.11, < 2) ffi (1.16.3) - fugit (1.9.0) - et-orbi (~> 1, >= 1.2.7) + fugit (1.11.1) + et-orbi (~> 1, >= 1.2.11) raabro (~> 1.4) fuubar (2.5.1) rspec-core (~> 3.0) @@ -380,7 +380,7 @@ GEM redis (>= 3.3) resque (>= 1.27) rufus-scheduler (~> 3.2, != 3.3) - rexml (3.3.4) + rexml (3.3.6) strscan rmagick (6.0.1) observer (~> 0.1) diff --git a/app/MARKUS_VERSION b/app/MARKUS_VERSION index 30acdc6b3c..3c981334fc 100644 --- a/app/MARKUS_VERSION +++ b/app/MARKUS_VERSION @@ -1 +1 @@ -VERSION=v2.5.0,PATCH_LEVEL=DEV +VERSION=v2.5.1,PATCH_LEVEL=DEV diff --git a/app/assets/javascripts/Components/Result/text_viewer.jsx b/app/assets/javascripts/Components/Result/text_viewer.jsx index eadb5306a0..b3fad2514d 100644 --- a/app/assets/javascripts/Components/Result/text_viewer.jsx +++ b/app/assets/javascripts/Components/Result/text_viewer.jsx @@ -115,7 +115,7 @@ export class TextViewer extends React.PureComponent { } } if (currLine.textContent.length > 0) { - nodeLines.appendChild(currLine); + nodeLines.push(currLine); } nodeLines.push(this.raw_content.current.lastChild.cloneNode(true)); while (this.raw_content.current.firstChild) { diff --git a/app/assets/javascripts/Components/__tests__/text_viewer.test.jsx b/app/assets/javascripts/Components/__tests__/text_viewer.test.jsx index 30b1e10bca..373eae78aa 100644 --- a/app/assets/javascripts/Components/__tests__/text_viewer.test.jsx +++ b/app/assets/javascripts/Components/__tests__/text_viewer.test.jsx @@ -5,7 +5,9 @@ import {TextViewer} from "../Result/text_viewer"; describe("TextViewer", () => { let props; - beforeEach(() => { + afterEach(cleanup); + + it("should render its text content when the content ends with a new line", () => { props = { content: "def f(n: int) -> int:\n return n + 1\n", annotations: [], @@ -14,11 +16,20 @@ describe("TextViewer", () => { }; render(); + + expect(screen.getByText("def f(n: int) -> int:")).toBeInTheDocument(); }); - afterEach(cleanup); + it("should render its text content when the content doesn't end with a new line", () => { + props = { + content: "def f(n: int) -> int:\n return n + 1", + annotations: [], + focusLine: null, + submission_file_id: 1, + }; + + render(); - it("should render its text content", () => { expect(screen.getByText("def f(n: int) -> int:")).toBeInTheDocument(); }); });