Skip to content

Some posts don't generate excerpts #19

Answered by daveaglick
CharliePoole asked this question in Q&A
Discussion options

You must be logged in to vote

It's a chicken-and-egg problem. The behavior you're seeing is actually baked into the Content pipeline (by this point in the code, Markdown has been evaluated into HTML, but Razor has not):

The problem is that Razor isn't actually HTML, so trying to use an HTML library like AngleSharp to parse a .cshtml file as if it were and then find the first <p> is brittle at best, and was causing lots of bug reports. Since Razor (and other templating languages) can also use code, the excerpts for Razor files tended to be goofy even when they did work (they would contain things like @Html.Whatever() right in the excerpt content). It only kind of worked in Wyam if you got lucky and the Razor didn't ha…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@CharliePoole
Comment options

Answer selected by CharliePoole
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants