Skip to content

Commit

Permalink
just ran prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcos Hernandez committed Oct 7, 2023
1 parent 210d56c commit d1f4f9b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/app/(tabs)/search/story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ function StoryScreen() {
};

const htmlParser = (html: string) => {
const regex = /<p>(.*?)<\/p>/;
const regex = /<h2(.*?)h2>(\n+<p(.*?)p>)+/; // <p>.*?<\/p>/;
const corresp = regex.exec(html);
const firstParagraph = corresp ? corresp[0] : ''; // <p>text1</p>
const firstParagraphWithoutHtml = corresp ? corresp[1] : ''; // text1
return firstParagraph;
return corresp[0];
};

useEffect(() => {
Expand All @@ -43,6 +43,7 @@ function StoryScreen() {
<ScrollView>
<HTMLView value={title} />
<HTMLView value={htmlParser(content)} />
{/* <HTMLView value={htmlParser(content)} /> */}
</ScrollView>
)}
</SafeAreaView>
Expand Down

0 comments on commit d1f4f9b

Please sign in to comment.