forked from Gitlink/forgeplus-react
update
This commit is contained in:
parent
59edb107ee
commit
9427a3500f
|
@ -6,22 +6,18 @@ const map = {
|
|||
'colorBlue': 'colorBlue', // 蓝字白底
|
||||
}
|
||||
class ActionBtn extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
render() {
|
||||
let { to, children, style, className, ...others } = this.props
|
||||
return (
|
||||
<React.Fragment>
|
||||
{
|
||||
to == undefined ?
|
||||
to === undefined ?
|
||||
<a onClick={this.props.onClick}
|
||||
{...others}
|
||||
className={"Actionbtn " + `${map[style || 'blue']} ${this.props.className}`}
|
||||
className={`Actionbtn ${map[style || 'blue']} ${this.props.className}`}
|
||||
>{children}</a>
|
||||
:
|
||||
<Link to={to} className={"btn " + `${map[this.props.style]} ${this.props.className}`} {...others}>{this.props.children}</Link>
|
||||
<Link to={to} className={`btn ${map[this.props.style]} ${this.props.className}`} {...others}>{this.props.children}</Link>
|
||||
}
|
||||
</React.Fragment>
|
||||
)
|
||||
|
|
|
@ -5,12 +5,13 @@ import { exportMdtoHtml } from 'educoder'
|
|||
let preRegex = /<pre[^>]*>/g
|
||||
export default ({ value = '', is_md = true, className, style = {} }) => {
|
||||
let html = is_md ? exportMdtoHtml(value) : value
|
||||
html = html.replace(/▁/g, "▁▁▁").replace('<p>[TOC]</p>', '')
|
||||
console.log(html, '----========')
|
||||
html = html.replace(/▁/g, "▁▁▁")
|
||||
const el = useRef()
|
||||
|
||||
useEffect(() => {
|
||||
if (el.current && html) {
|
||||
if (preRegex.test(html)) {
|
||||
if (html.match(preRegex)) {
|
||||
window.PR.prettyPrint()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -112,7 +112,7 @@ class CaseDetail extends Component {
|
|||
}
|
||||
|
||||
{
|
||||
operation && operation.can_editable ? <ActionBtn style="colorBlue" to={`/moop_cases/${this.props.match.params.caseID}/edit`} className="fr mr20">编辑</ActionBtn> : ""
|
||||
operation && operation.can_editable ? <ActionBtn style=" colorBlue" to={`/moop_cases/${this.props.match.params.caseID}/edit`} className="fr mr20">编辑</ActionBtn> : ""
|
||||
}
|
||||
</li>
|
||||
<li className="clearfix lineh-20">
|
||||
|
|
Loading…
Reference in New Issue