removed striphtml (as per lidarr)

This commit is contained in:
Robin Dadswell
2021-01-03 22:53:06 +00:00
committed by nitsua
parent cfc52d12ea
commit f496d96907
8 changed files with 7 additions and 22 deletions
+1 -2
View File
@@ -139,8 +139,7 @@ class Queue extends Component {
allUnselected,
selectedState,
isConfirmRemoveModalOpen,
isPendingSelected,
items
isPendingSelected
} = this.state;
const isRefreshing = isFetching || isAuthorFetching || isBooksFetching || isRefreshMonitoredDownloadsExecuting;
+1 -1
View File
@@ -515,7 +515,7 @@ class AuthorDetails extends Component {
<div className={styles.overview}>
<TextTruncate
line={Math.floor(125 / (defaultFontSize * lineHeight))}
text={stripHtml(overview)}
text={overview}
/>
</div>
</div>
@@ -204,7 +204,7 @@ class AuthorIndexOverview extends Component {
>
<TextTruncate
line={Math.floor(overviewHeight / (defaultFontSize * lineHeight))}
text={stripHtml(overview)}
text={overview}
/>
</Link>
+1 -2
View File
@@ -29,7 +29,6 @@ import InteractiveSearchTable from 'InteractiveSearch/InteractiveSearchTable';
import OrganizePreviewModalConnector from 'Organize/OrganizePreviewModalConnector';
import fonts from 'Styles/Variables/fonts';
import formatBytes from 'Utilities/Number/formatBytes';
import stripHtml from 'Utilities/String/stripHtml';
import BookDetailsLinks from './BookDetailsLinks';
import styles from './BookDetails.css';
@@ -361,7 +360,7 @@ class BookDetails extends Component {
<div className={styles.overview}>
<TextTruncate
line={Math.floor(125 / (defaultFontSize * lineHeight))}
text={stripHtml(overview)}
text={overview}
/>
</div>
</div>
@@ -190,7 +190,7 @@ class AddNewAuthorSearchResult extends Component {
<TextTruncate
truncateText="…"
line={Math.floor(height / (defaultFontSize * lineHeight))}
text={stripHtml(overview)}
text={overview}
/>
</div>
</div>
@@ -93,7 +93,7 @@ class AddNewBookModalContent extends Component {
<TextTruncate
truncateText="…"
line={8}
text={stripHtml(overview)}
text={overview}
/>
</div> :
null
@@ -175,7 +175,7 @@ class AddNewBookSearchResult extends Component {
<TextTruncate
truncateText="…"
line={Math.floor(height / (defaultFontSize * lineHeight))}
text={stripHtml(overview)}
text={overview}
/>
</div>
</div>
@@ -1,13 +0,0 @@
function stripHtml(html) {
if (!html) {
return html;
}
const fiddled = html.replace(/<br\/>/g, ' ');
const doc = new DOMParser().parseFromString(fiddled, 'text/html');
const text = doc.body.textContent || '';
return text.replace(/([;,.])([^\s.])/g, '$1 $2').replace(/\s{2,}/g, ' ').replace(/s+…/g, '…');
}
export default stripHtml;