mirror of
https://github.com/filecoin-project/slate.git
synced 2024-12-24 17:44:50 +03:00
fix prettier
This commit is contained in:
parent
14dc8d3bce
commit
c3b9f4d105
@ -4,7 +4,7 @@ import * as Actions from "~/common/actions";
|
||||
import * as Strings from "~/common/strings";
|
||||
import * as StringReplace from "~/vendor/react-string-replace";
|
||||
|
||||
import { Markdown } from './Markdown'
|
||||
import { Markdown } from "./Markdown";
|
||||
import { css } from "@emotion/core";
|
||||
|
||||
const LINK_STYLES = `
|
||||
@ -50,16 +50,15 @@ const onDeepLink = async (object) => {
|
||||
return window.open(slug);
|
||||
};
|
||||
|
||||
const ProcessedLink = ({href, children, dark}) => {
|
||||
|
||||
|
||||
}
|
||||
const ProcessedLink = ({ href, children, dark }) => {};
|
||||
|
||||
const Link = ({ href, children, dark }) => {
|
||||
return <a css={dark ? STYLES_LINK_DARK: STYLES_LINK} href={href} target="_blank" rel="nofollow">
|
||||
return (
|
||||
<a css={dark ? STYLES_LINK_DARK : STYLES_LINK} href={href} target="_blank" rel="nofollow">
|
||||
{children}
|
||||
</a>
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
const LinkMention = () => {
|
||||
replacedText = StringReplace(
|
||||
@ -76,7 +75,7 @@ const LinkMention = () => {
|
||||
</a>
|
||||
)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
const LinkHash = () => {
|
||||
//NOTE(martina): previous regex: /#(\w*[0-9a-zA-Z-_]+\w*[0-9a-zA-Z-_])\/(\w*[0-9a-zA-Z-_]+\w*[0-9a-zA-Z-_])/g,
|
||||
@ -96,15 +95,15 @@ const LinkHash = () => {
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export const ProcessedText = ({ text, dark }) => {
|
||||
let replacedText;
|
||||
const remarkReactComponents = {
|
||||
a: (props) => dark ? <Link dark {...props} /> : <Link {...props} />,
|
||||
a: (props) => (dark ? <Link dark {...props} /> : <Link {...props} />),
|
||||
};
|
||||
|
||||
return <Markdown md={text} options={{remarkReactComponents}} />
|
||||
return <Markdown md={text} options={{ remarkReactComponents }} />;
|
||||
|
||||
// replacedText = StringReplace(text, /(https?:\/\/\S+)/g, (match, i) => (
|
||||
// <a css={dark ? STYLES_LINK_DARK : STYLES_LINK} key={match + i} href={match} target="_blank">
|
||||
|
Loading…
Reference in New Issue
Block a user