Skip to content

Commit

Permalink
Refactor some more
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Sep 28, 2023
1 parent 5445cbb commit 1d5cbf5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ import {unified} from 'unified'
import {visit} from 'unist-util-visit'
import {VFile} from 'vfile'

const own = {}.hasOwnProperty
const changelog =
'https://github.com/remarkjs/react-markdown/blob/main/changelog.md'

Expand Down Expand Up @@ -251,7 +250,10 @@ export function Markdown(options) {
let key

for (key in urlAttributes) {
if (own.call(urlAttributes, key) && own.call(node.properties, key)) {
if (
Object.hasOwn(urlAttributes, key) &&
Object.hasOwn(node.properties, key)
) {
const value = node.properties[key]
const test = urlAttributes[key]
if (test === null || test.includes(node.tagName)) {
Expand Down

0 comments on commit 1d5cbf5

Please sign in to comment.