mathspp
  • Blog
    • Pydon'ts
    • Problems
    • TIL
    • Twitter threads
  • Books
  • Talks
  • Trainings
    • Advanced iteration
    • Python for scripting and automation
    • Rust for Python developers
  • Courses
  • About
Link blog

PHP Markdown Extra – Markdown Inside HTML Blocks

on 22-01-2025 20:33

This page documents “Markdown Extra”, an extension of Markdown that I use on my website. I'm blogging about this because the section “Markdown Inside HTML Blocks” shows how to tell the Markdown parser that I have Markdown nested inside HTML blocks.

This is particularly useful because sometimes I like to include code blocks inside the HTML tag <details>. The link shows that I have to add the attribute markdown="1" to the HTML tag that will contain nested Markdown and the parser takes care of the rest (and removes the attribute).

Here's a tag <details> that uses the attribute in the source code:

Attribute was used.
print("Hello, world!")

Here's what the same HTML + Markdown combo will look like without the correct Markdown Extra attribute:

Attribute was not used. ```py print("Hello, world!") ```

Previous link Next link

Number 73 is a number packed with interesting properties.

mathspp
  • Blog
    • Pydon'ts
    • Problems
    • TIL
    • Twitter threads
  • Books
  • Talks
  • Trainings
    • Advanced iteration
    • Python for scripting and automation
    • Rust for Python developers
  • Courses
  • About