Skip to content

Commit

Permalink
More cleanup and fixes for standard spans.
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan McQuen <[email protected]>
  • Loading branch information
ryanpcmcquen committed Dec 24, 2020
1 parent aee9b7a commit 41c842d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/wiki_link.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ const createRemarkWikiLink = OriginalSpan => {
if (link) {
try {
const attributes = {
className: "wiki_link",
// href: `inkdrop://note/${link}`,
onClick: event => {
if (db) {
Expand Down Expand Up @@ -69,11 +68,12 @@ const createRemarkWikiLink = OriginalSpan => {
return /*#__PURE__*/React.createElement("span", {
className: "ui error message mde-error-message"
}, error.message);
}
},
...this.props
};

if (OriginalSpan) {
return /*#__PURE__*/React.createElement(OriginalSpan, null);
return /*#__PURE__*/React.createElement(OriginalSpan, this.props, this.props.children);
} else {
return /*#__PURE__*/React.createElement("span", attributes, link);
}
Expand Down
8 changes: 6 additions & 2 deletions src/wiki_link.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const createRemarkWikiLink = (OriginalSpan) => {
if (link) {
try {
const attributes = {
className: "wiki_link",
// href: `inkdrop://note/${link}`,
onClick: (event) => {
if (db) {
Expand Down Expand Up @@ -63,9 +62,14 @@ const createRemarkWikiLink = (OriginalSpan) => {
</span>
);
},
...this.props,
};
if (OriginalSpan) {
return <OriginalSpan />;
return (
<OriginalSpan {...this.props}>
{this.props.children}
</OriginalSpan>
);
} else {
return <span {...attributes}>{link}</span>;
}
Expand Down

0 comments on commit 41c842d

Please sign in to comment.