Skip to content

Commit

Permalink
one paragraph is able to show
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcos Hernandez committed Oct 11, 2023
2 parents 24efe19 + 5cb3a8d commit 77f2de8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/app/(tabs)/search/story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ function StoryScreen() {
}
};

const htmlParser = (html: string) => {
const regex = /<h2(.*?)h2>(\n+<p(.*?)p>)+/; // regex grabs heading and paragraph tags for story
const corresp = regex.exec(html);
const story = corresp ? corresp[0] : ''; // <h2>heading<h2> <p>paragraph1</p> ...
return story;
};

useEffect(() => {
getStory('170947');
}, []);
Expand Down

0 comments on commit 77f2de8

Please sign in to comment.