Skip to content

Commit

Permalink
style: remove no-needed backslash
Browse files Browse the repository at this point in the history
  • Loading branch information
bubkoo committed Dec 8, 2019
1 parent 9ef36c8 commit 7caa5e5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/x6/src/util/dom/attr.ts
Expand Up @@ -3,7 +3,7 @@ import { getUrlWithoutHash } from '../bom'

export function setAttributes(
elem: Element | null,
attrs: { [key: string]: any }
attrs: { [key: string]: any },
) {
if (elem != null) {
Object.keys(attrs).forEach(name => elem.setAttribute(name, attrs[name]))
Expand All @@ -13,7 +13,7 @@ export function setAttributes(
export function setAttributeWithAnchor(
elem: SVGElement,
attrName: string,
id: string
id: string,
) {
if (
!detector.IS_IE &&
Expand All @@ -22,7 +22,7 @@ export function setAttributeWithAnchor(
!detector.IS_CHROME_APP &&
elem.ownerDocument === document
) {
const base = getUrlWithoutHash().replace(/([\(\)])/g, '\\$1')
const base = getUrlWithoutHash().replace(/([()])/g, '\\$1')
elem.setAttribute(attrName, `url(${base}#${id})`)
} else {
elem.setAttribute(attrName, `url(#${id})`)
Expand Down

0 comments on commit 7caa5e5

Please sign in to comment.