Skip to content

Commit

Permalink
Fixed a bug in ExtractFrontMatter to ensure front matter is extract…
Browse files Browse the repository at this point in the history
…ed on the last line of a file
  • Loading branch information
daveaglick committed Jan 24, 2023
1 parent 1e0da7a commit fe6d2e8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 1.0.0-beta.54

- Fixed a bug in front matter regular expressions to ensure front matter is extracted when the delimiter is on the last line of the file.
- Updated Statiq Framework reference to version [1.0.0-beta.66](https://github.com/statiqdev/Statiq.Framework/releases/tag/v1.0.0-beta.66).

# 1.0.0-beta.53

- Added a new `AdditionalInputFiles` setting that can be used to explicitly include input files that would otherwise be excluded by the `InputFiles` setting such as underscore files.
Expand Down
6 changes: 3 additions & 3 deletions src/Statiq.Web/Bootstrapper/BootstrapperExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ private static TBootstrapper AddDefaultWebSettings<TBootstrapper>(this TBootstra
WebKeys.FrontMatterRegexes,
new string[]
{
@"\A(?:^\r*/\*-+[^\S\n]*$\r?\n)(.*?)(?:^\r*-+\*/[^\S\n]*$\r?\n)", // C-style: /*- ... -*/
@"\A(?:^\r*<!---+[^\S\n]*$\r?\n)(.*?)(?:^\r*-+-->[^\S\n]*$\r?\n)", // HTML-style: <!--- ... ---!>
@"\A(?:^\r*@\*-+[^\S\n]*$\r?\n)(.*?)(?:^\r*-+\*@[^\S\n]*$\r?\n)", // Razor-style: @*- ... -*@
@"\A(?:^\r*/\*-+[^\S\n]*$\r?\n)(.*?)(?:^\r*-+\*/[^\S\n]*$(\r?\n)?)", // C-style: /*- ... -*/
@"\A(?:^\r*<!---+[^\S\n]*$\r?\n)(.*?)(?:^\r*-+-->[^\S\n]*$(\r?\n)?)", // HTML-style: <!--- ... ---!>
@"\A(?:^\r*@\*-+[^\S\n]*$\r?\n)(.*?)(?:^\r*-+\*@[^\S\n]*$(\r?\n)?)", // Razor-style: @*- ... -*@
ExtractFrontMatter.GetDelimiterRegex("-", true), // Jekyll-style: --- ... ---, comes last since it's more general and doesn't require a start delimiter
}
}
Expand Down

0 comments on commit fe6d2e8

Please sign in to comment.