Open zeke opened 7 years ago
Say I have some HTML like this:
<h1>Title</h1> <p>Hello, world</p> <p>Hello again, world</p> <hr> <p>This is where the content really gets going, world</p>
I want to use <hr> as the excerpt cutoff, like so:
<hr>
excerpt(myString, {moreRegExp: /<hr>/i})
Unfortunately the excerpt also includes the <h1> content. Would you be open to adding an option to omit h1-h6 tags from the excerpt?
<h1>
A real-world example of this can be found on the Electron blog, where Jekyll's excerpt creation ignores headings by default:
I guess it is perfectly possible to add that ^_^ any PR welcome!
Say I have some HTML like this:
I want to use
<hr>
as the excerpt cutoff, like so:Unfortunately the excerpt also includes the
<h1>
content. Would you be open to adding an option to omit h1-h6 tags from the excerpt?A real-world example of this can be found on the Electron blog, where Jekyll's excerpt creation ignores headings by default: