Skip to content

Markdown headings are not parsed inside WRAP containers #291

Description

@Phildrim

Dokuwiki's new Markdown support does not appear to parse Markdown headings inside WRAP containers.
Lists and quotes work correctly using the md+dw syntax flavor.

Steps to reproduce
Using the md+dw syntax flavor:

<WRAP>
# heading
- item
> quote
</WRAP>

Actual behavior

  • # heading is rendered als normal text
  • The list and quote are parsed correctly

Possible cause

The problem seem to be related to /lib/plugins/wrap/syntax/div.php
I tested adding 'baseonly' to function getAllowedTypes() { return array('container', 'formatting', 'substition', 'protected', 'disabled', 'paragraphs'); }
That fixed my heading problem but created problems with list via

<WRAP>
{{topic>test}}
</WRAP>

The problem seems to be that WRAP handles headings in doku-wiki syntax seperately because it isnt't only a formatting issue:

case DOKU_LEXER_MATCHED:
                // we have a == header ==, use the core header() renderer
                // (copied from core header() in inc/parser/handler.php)
                $title = trim($match);
                $level = 7 - strspn($title,'=');
                if($level < 1) $level = 1;
                $title = trim($title,'=');
                $title = trim($title);

It may therefore require similar handling for headings produced by the Markdown parser.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions