LGTM.com-inspired changes:
- Fix: Ensure all apostrophes are escaped for `toXml` utility - Fix: Avoid error if `URL` is not defined - Fix (jPicker): Precision argument had not been passed in previously - Fix (Star extension): Minor: Avoid erring if `inradius` is `NaN` - Refactoring: Avoid passing unused arguments, setting unused variables, and making unnecessary checks; avoid useless call to `createSVGMatrix` - Linting (LGTM): Add `lgtm.yml` file (still some remaining items flagged but hoping for in-code flagging) - Docs: Contributing file
This commit is contained in:
@@ -112,7 +112,7 @@ export const init = function (editorContext) {
|
||||
export const toXml = function (str) {
|
||||
// ' is ok in XML, but not HTML
|
||||
// > does not normally need escaping, though it can if within a CDATA expression (and preceded by "]]")
|
||||
return str.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/, ''');
|
||||
return str.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, '''); // Note: `'` is XML only
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -619,7 +619,7 @@ export const getBBox = function (elem) {
|
||||
default:
|
||||
|
||||
if (elname === 'use') {
|
||||
ret = groupBBFix(selected, true);
|
||||
ret = groupBBFix(selected); // , true);
|
||||
}
|
||||
if (elname === 'use' || (elname === 'foreignObject' && isWebkit())) {
|
||||
if (!ret) { ret = selected.getBBox(); }
|
||||
|
||||
Reference in New Issue
Block a user