Skip to content
This repository was archived by the owner on Oct 18, 2025. It is now read-only.
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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: 2.1
orbs:
codecov: codecov/codecov@3.3.0
codecov: codecov/codecov@5.2.1
jobs:
test:
docker:
Expand Down
20 changes: 10 additions & 10 deletions angular-diff-match-patch.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ angular.module('diff-match-patch', [])
}
}

function diffAttrName(op) {
function diffAttributeName(op) {
switch (op) {
case DIFF_INSERT: {
return 'insert';
Expand All @@ -81,10 +81,10 @@ angular.module('diff-match-patch', [])
}
}

function getTagAttrs(options, op, attrs) {
function getTagAttributes(options, op, attributes) {
const tagOptions = {};
const returnValue = [];
const opName = diffAttrName(op);
const opName = diffAttributeName(op);

if (angular.isDefined(options) && angular.isDefined(options.attrs)) {
const attributesFromOptions = options.attrs[opName];
Expand All @@ -93,8 +93,8 @@ angular.module('diff-match-patch', [])
}
}

if (angular.isDefined(attrs)) {
angular.merge(tagOptions, attrs);
if (angular.isDefined(attributes)) {
angular.merge(tagOptions, attributes);
}

if (Object.keys(tagOptions).length === 0) {
Expand All @@ -111,11 +111,11 @@ angular.module('diff-match-patch', [])
function getHtmlPrefix(op, display, options) {
switch (display) {
case displayType.LINEDIFF: {
return '<div class="' + diffClass(op) + '"><span' + getTagAttrs(options, op, {class: 'noselect'}) + '>' + diffSymbol(op) + '</span>';
return '<div class="' + diffClass(op) + '"><span' + getTagAttributes(options, op, {class: 'noselect'}) + '>' + diffSymbol(op) + '</span>';
}

default: { // case displayType.INSDEL:
return '<' + diffTag(op) + getTagAttrs(options, op) + '>';
return '<' + diffTag(op) + getTagAttributes(options, op) + '>';
}
}
}
Expand Down Expand Up @@ -159,7 +159,7 @@ angular.module('diff-match-patch', [])
let intraHtml2;

for (x = 0; x < diffData.length; x++) {
diffData[x][1] = diffData[x][1].replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
diffData[x][1] = diffData[x][1].replaceAll('&', '&amp;').replaceAll('<', '&lt;').replaceAll('>', '&gt;');
}

for (y = 0; y < diffData.length; y++) {
Expand All @@ -177,7 +177,7 @@ angular.module('diff-match-patch', [])
} else {
html[y] = createHtmlLines(text, op, options);
}
} else if (typeof excludeOp === 'undefined' || op !== excludeOp) {
} else if (excludeOp === undefined || op !== excludeOp) {
html[y] = getHtmlPrefix(op, display, options) + text + getHtmlSuffix(op, display);
}
}
Expand Down Expand Up @@ -212,7 +212,7 @@ angular.module('diff-match-patch', [])
const line = text.slice(lineStart, lineEnd + ((ignoreTrailingNewLines && hasNewLine) ? 0 : 1));
lineStart = lineEnd + 1;

if (Object.prototype.hasOwnProperty.call(lineHash, line)) {
if (Object.hasOwn(lineHash, line)) {
chars += String.fromCharCode(lineHash[line]); // eslint-disable-line unicorn/prefer-code-point
} else {
chars += String.fromCharCode(lineArrayLength); // eslint-disable-line unicorn/prefer-code-point
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
"karma-coverage": "2.2.1",
"karma-jasmine": "5.1.0",
"karma-junit-reporter": "2.0.1",
"puppeteer": "24.2.0",
"puppeteer": "24.2.1",
"standard-version": "9.5.0",
"xo": "0.58.0"
"xo": "0.60.0"
},
"xo": {
"plugins": [
Expand Down Expand Up @@ -67,5 +67,5 @@
"diff_match_patch"
]
},
"packageManager": "yarn@4.3.1+sha512.af78262d7d125afbfeed740602ace8c5e4405cd7f4735c08feb327286b2fdb2390fbca01589bfd1f50b1240548b74806767f5a063c94b67e431aabd0d86f7774"
"packageManager": "yarn@4.6.0+sha512.5383cc12567a95f1d668fbe762dfe0075c595b4bfff433be478dbbe24e05251a8e8c3eb992a986667c1d53b6c3a9c85b8398c35a960587fbd9fa3a0915406728"
}
Loading