I have a html as string(with Tag in it as shown below in p tag ) and I want to slice only contain data but problem is slice method divide the string with html tag and that can't generate required output.
So I Want to slice the String with opening and closing tag of the html and divide the content into section with tags and their styling should not be removed.
My Present function slice with static value with index of interval like slice(0,500), slice(500, 1000) and so on. In doing that I divide the string with their respective styling properties also because of that styling is divide into two parts and for that reason it does not apply on the tag.
<p style="margin: 0px 0px 15px; font-size: 14px;">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, "</p><h3 style="margin: 15px 0px; padding: 0px; font-size: 14px; color: rgb(0, 0, 0); font-family: "Open Sans", Arial, sans-serif;">Section 1.10.32 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC</h3>
I am generating pdf from html in react-native. I want To divide the above html string into different pages so I am using the slice method to divide into sections and then applying page break but it divide the string with respect to tags and style property.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I have a html as string(with Tag in it as shown below in p tag ) and I want to slice only contain data but problem is slice method divide the string with html tag and that can't generate required output.
So I Want to slice the String with opening and closing tag of the html and divide the content into section with tags and their styling should not be removed.
My Present function slice with static value with index of interval like slice(0,500), slice(500, 1000) and so on. In doing that I divide the string with their respective styling properties also because of that styling is divide into two parts and for that reason it does not apply on the tag.
<p style="margin: 0px 0px 15px; font-size: 14px;">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, "</p>
<h3 style="margin: 15px 0px; padding: 0px; font-size: 14px; color: rgb(0, 0, 0); font-family: "Open Sans", Arial, sans-serif;">Section 1.10.32 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC</h3>
I am generating pdf from html in react-native. I want To divide the above html string into different pages so I am using the slice method to divide into sections and then applying page break but it divide the string with respect to tags and style property.
i post this also in stack overflow link is https://stackoverflow.com/questions/73036936/how-to-slice-a-string-which-contain-html-tag-with-it-and-slice-with-respect-to-o