Merge pull request #17 from emmawinston/spoiler-tag-syntax-fix

Corrects syntax for spoiler tags to valid HTML (fixes #10)
This commit is contained in:
Darius Kazemi 2019-09-12 10:48:37 -07:00 committed by GitHub
commit 44486bdada
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -223,7 +223,7 @@ export default class StatusContent extends React.PureComponent {
<p style={{ marginBottom: hidden && status.get('mentions').isEmpty() ? '0px' : null }}>
<span dangerouslySetInnerHTML={spoilerContent} lang={status.get('language')} />
{' '}
{status.get('activity_pub_type') === 'Article' ? '' : <div><button tabIndex='0' className={`status__content__spoiler-link ${hidden ? 'status__content__spoiler-link--show-more' : 'status__content__spoiler-link--show-less'}`} onClick={this.handleSpoilerClick}>{toggleText}</button></div>}
{status.get('activity_pub_type') === 'Article' ? '' : <span class="show_more_button"><button tabIndex='0' className={`status__content__spoiler-link ${hidden ? 'status__content__spoiler-link--show-more' : 'status__content__spoiler-link--show-less'}`} onClick={this.handleSpoilerClick}>{toggleText}</button></span>}
</p>
{mentionsPlaceholder}

View File

@ -6017,3 +6017,14 @@ noscript {
padding: 0.35rem;
}
}
div.status__content,
div.status__content--with-action,
div.status__content--with-spoiler {
p {
span.show_more_button {
display: block;
margin: 0.25rem 0 0 0;
}
}
}