Skip to content
Code on GitHub (opens in a new tab)

← All the news

Ehundu 0.10.0

Formatted text in a field is converted to HTML with the markdown filter. Until now only the body of a page could be converted from Markdown: a headline with an italic word, or a summary with some bold, had no way of reaching the template as HTML. With titular: "A kitchen that *travels*", {{ pagina.titular|markdown }} gives A kitchen that <em>travels</em>. Without an argument it is inline: Markdown without blocks, without <p>, with emphasis, bold, strikethrough, code, links, automatic links and hand-written HTML (<mark>, <br>); a line break with a backslash or two spaces at the end of the line comes out as <br> (docs/formato.md (opens in a new tab), §7.3, decision 113).

And block-level, with markdown('bloque'). For a text with several paragraphs inside a block that the template provides: it is converted like the body, with paragraphs, lists, quotes and headings. It still has no shortcodes, and it does not turn images into figures, nor convert tables or footnotes, nor give headings an id: that is for the body (decision 114).

In both modes, links to other domains are treated as in the body (target, rel and the enlacesExternos notice), the result is not escaped again, an empty value gives nothing, a number is taken as text, and a list, a map or a yes or a no warn. A mode that does not exist warns and the inline one is used.

It came out of rebuilding a site with landing pages that are edited from a panel: the schema (§11) already offered the markdown type for any field, but the engine had no way to paint it.

0.9 sites build the same: they are new filters and change nothing that does not use them. Built from scratch with 0.9.0 and with this one, the sixteen test sites that build with 0.9 give the same files, one by one.

This version on GitHub (opens in a new tab), with the ehundu.phar.