Skip to content

compileOptions.permalink default changed from true to "raw" for Custom Template Syntaxes #2780

@danburzo

Description

@danburzo

Operating system

macOS Ventura 13.1

Eleventy

^2.0.0-beta.2 / 1.0.2

Describe the bug

Found while poking around replacing the built-in Markdown engine (see #2777) that when setting a replacement with .addExtension('md', { ... }), as exemplified in the docs, any explicit permalinks present in the frontmatter of .md sources will get processed with the replacement engine, as observed a while back (#1019).

This is a problem because most Markdown processors (including marked and remark) will wrap a plain string such as /path/to/output/ in <p> tags, thus breaking the output. I'm not sure if the default engine skips the Markdown step or whether markdown-it simply doesn't wrap a plain string, but the issue only manifests when changing to a different engine.

Reproduction steps

Eleventy config:

const marked = require('marked');
module.exports = config => {
	config.addExtension("md", {
		compile: inputContent => data => marked.parse(inputContent)
	});
};

Content file:

---
title: Hello world
permalink: hello-world/
---

## Heading

Paragraph.

Running Eleventy outputs the HTML to _site / <p>hello-world / < / p>.

Expected behavior

If permalinks passing through the Markdown engine is inevitable, it would be great to get enough arguments to the compile() function for authors to be able to discern when to skip Markdown processing.

Reproduction URL

No response

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions