]> Untitled Git - lemmy-ui.git/blobdiff - src/shared/components/common/html-tags.tsx
Strip html from og descriptions. Fixes #830 (#831)
[lemmy-ui.git] / src / shared / components / common / html-tags.tsx
index 56cf3238ed0abf23407c449efd27bdda03655eae..8f35b12f7335d0d070b99166e5474ef0b28beb30 100644 (file)
@@ -1,4 +1,5 @@
 import { Option } from "@sniptt/monads";
+import { htmlToText } from "html-to-text";
 import { Component } from "inferno";
 import { Helmet } from "inferno-helmet";
 import { httpExternalPath } from "../../env";
@@ -37,7 +38,9 @@ export class HtmlTags extends Component<HtmlTagsProps, any> {
             <meta
               key={n}
               name={n}
-              content={md.renderInline(this.props.description.unwrap())}
+              content={htmlToText(
+                md.renderInline(this.props.description.unwrap())
+              )}
             />
           ))}