Skip to content

Commit

Permalink
Strip p tags from redd.it post selftext
Browse files Browse the repository at this point in the history
  • Loading branch information
brookst authored and larsjohnsen committed Feb 16, 2023
1 parent 1fc7d6f commit ffbf1c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/modules/hosts/ireddit.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default new Host('ireddit', {
if (preview.variants.mp4) {
return {
type: 'VIDEO',
caption: postMetadata.selftext_html,
caption: postMetadata.selftext_html.replace(/<\/?p>/g, ''),
loop: true,
muted: true,
fallback: preview.variants.gif && preview.variants.gif.source.url,
Expand All @@ -27,7 +27,7 @@ export default new Host('ireddit', {
} else {
return {
type: 'IMAGE',
caption: postMetadata.selftext_html,
caption: postMetadata.selftext_html.replace(/<\/?p>/g, ''),
src: preview.source.url,
};
}
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/hosts/vreddit.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default new Host('vreddit', {
return {
type: 'VIDEO',
loop: true,
caption: postMetadata.selftext_html,
caption: postMetadata.selftext_html.replace(/<\/?p>/g, ''),
muted,
sources,
};
Expand Down

0 comments on commit ffbf1c9

Please sign in to comment.