Skip to content

Commit

Permalink
internal/compiler: add .mdx as default Markdown file extension
Browse files Browse the repository at this point in the history
This update sets Scriggo to recognize files with the '.mdx' extension as
Markdown by default. It ensures that files using this extension are
treated as Markdown files in the Scriggo environment.
  • Loading branch information
gazerro committed Dec 4, 2024
1 parent 36bdc9b commit 0025e57
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/compiler/parser_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ func readFileAndFormat(fsys fs.FS, name string) ([]byte, ast.Format, error) {
format = ast.FormatJS
case ".json":
format = ast.FormatJSON
case ".md", ".mkd", ".mkdn", ".mdown", ".markdown":
case ".md", ".mdx", ".mkd", ".mkdn", ".mdown", ".markdown":
format = ast.FormatMarkdown
}
}
Expand Down
2 changes: 1 addition & 1 deletion templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ var formatTypes = map[ast.Format]reflect.Type{
// CSS : .css
// JavaScript : .js
// JSON : .json
// Markdown : .md .mkd .mkdn .mdown .markdown
// Markdown : .md .mdx .mkd .mkdn .mdown .markdown
// Text : all other extensions
//
// If the named file does not exist, BuildTemplate returns an error satisfying
Expand Down

0 comments on commit 0025e57

Please sign in to comment.