Conservative rich media parsing
This commit is contained in:
parent
811ccdce20
commit
ebef1ece7a
|
@ -150,7 +150,7 @@ export default class Card extends React.PureComponent {
|
||||||
const cardWidth = card.get('width', card.getIn(['pleroma', 'opengraph', 'width']));
|
const cardWidth = card.get('width', card.getIn(['pleroma', 'opengraph', 'width']));
|
||||||
const cardHeight = card.get('height', card.getIn(['pleroma', 'opengraph', 'height']));
|
const cardHeight = card.get('height', card.getIn(['pleroma', 'opengraph', 'height']));
|
||||||
const provider = card.get('provider_name').length === 0 ? decodeIDNA(getHostname(card.get('url'))) : card.get('provider_name');
|
const provider = card.get('provider_name').length === 0 ? decodeIDNA(getHostname(card.get('url'))) : card.get('provider_name');
|
||||||
const interactive = card.get('type') !== 'link' || card.getIn(['pleroma', 'opengraph', 'html']);
|
const interactive = card.get('type') !== 'link';
|
||||||
const horizontal = (!compact && cardWidth > cardHeight && (cardWidth + 100 >= width)) || interactive || embedded;
|
const horizontal = (!compact && cardWidth > cardHeight && (cardWidth + 100 >= width)) || interactive || embedded;
|
||||||
const className = classnames('status-card', { horizontal, compact, interactive });
|
const className = classnames('status-card', { horizontal, compact, interactive });
|
||||||
const title = interactive ? <a className='status-card__title' href={card.get('url')} title={card.get('title')} rel='noopener' target='_blank'><strong>{card.get('title')}</strong></a> : <strong className='status-card__title' title={card.get('title')}>{card.get('title')}</strong>;
|
const title = interactive ? <a className='status-card__title' href={card.get('url')} title={card.get('title')} rel='noopener' target='_blank'><strong>{card.get('title')}</strong></a> : <strong className='status-card__title' title={card.get('title')}>{card.get('title')}</strong>;
|
||||||
|
|
Loading…
Reference in New Issue