mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-29 05:29:37 +08:00
fix: find p tag content
This commit is contained in:
parent
35c537ee2d
commit
50606289d7
@ -1,7 +1,6 @@
|
||||
import React, { Children, cloneElement } from 'react';
|
||||
import { FormattedMessage, injectIntl } from 'react-intl';
|
||||
import { Helmet } from 'react-helmet';
|
||||
import flatten from 'lodash/flatten';
|
||||
import { getChildren } from 'jsonml.js/lib/utils';
|
||||
import { Timeline, Alert, Affix } from 'antd';
|
||||
import EditButton from './EditButton';
|
||||
@ -74,7 +73,10 @@ class Article extends React.Component {
|
||||
const { title, subtitle, filename } = meta;
|
||||
const isNotTranslated = locale === 'en-US' && typeof title === 'object';
|
||||
const helmetTitle = `${title[locale] || title} - Ant Design`;
|
||||
const contentChild = flatten(getChildren(content.content));
|
||||
const contentChild = getChildren(content.content).find(jml => {
|
||||
const [tag] = jml;
|
||||
return tag === 'p';
|
||||
});
|
||||
return (
|
||||
/* eslint-disable-next-line */
|
||||
<article className="markdown" onClick={this.onResourceClick}>
|
||||
|
@ -3,7 +3,6 @@ import { Helmet } from 'react-helmet';
|
||||
import { FormattedMessage, injectIntl } from 'react-intl';
|
||||
import classNames from 'classnames';
|
||||
import { Row, Col, Icon, Affix, Tooltip } from 'antd';
|
||||
import flatten from 'lodash/flatten';
|
||||
import { getChildren } from 'jsonml.js/lib/utils';
|
||||
import Demo from './Demo';
|
||||
import EditButton from './EditButton';
|
||||
@ -108,7 +107,11 @@ class ComponentDoc extends React.Component {
|
||||
'show-riddle-button': showRiddleButton,
|
||||
});
|
||||
const helmetTitle = `${subtitle || ''} ${title[locale] || title} - Ant Design`;
|
||||
const contentChild = flatten(getChildren(content));
|
||||
const contentChild = getChildren(content.content).find(jml => {
|
||||
const [tag] = jml;
|
||||
return tag === 'p';
|
||||
});
|
||||
|
||||
return (
|
||||
<article className={articleClassName}>
|
||||
<Helmet>
|
||||
|
Loading…
Reference in New Issue
Block a user