Skip to content

Commit

Permalink
Fixes wrong order in filtering out the empty values and numbers less …
Browse files Browse the repository at this point in the history
…than one. (#1255)
  • Loading branch information
deepakjosp authored Oct 30, 2024
1 parent 45569f6 commit 57fe4a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ export default CodeBlockLowlight.extend({
parseHTML: element =>
element.dataset.highlightedLines
?.split(",")
.filter(Boolean)
.map(Number) || [],
.map(Number)
.filter(Boolean) || [],
renderHTML: attributes => ({
"data-highlighted-lines":
attributes.highlightedLines?.join(",") ?? "",
Expand Down
4 changes: 2 additions & 2 deletions src/components/EditorContent/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ export const applyLineHighlighting = editorContent => {
if (highlightedLines) {
const linesToHighlight = highlightedLines
.split(",")
?.filter(Boolean)
.map(Number);
.map(Number)
.filter(Boolean);

const highlightLinesOptions = linesToHighlight.map(line => ({
start: line,
Expand Down

0 comments on commit 57fe4a0

Please sign in to comment.