Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make markdown_attribute work like in PHP Markdown Extra and multimarkdown #1378

Closed
bpj opened this issue Jun 28, 2014 · 0 comments
Closed

Make markdown_attribute work like in PHP Markdown Extra and multimarkdown #1378

bpj opened this issue Jun 28, 2014 · 0 comments

Comments

@bpj
Copy link

bpj commented Jun 28, 2014

jgm wrote:
+++ BP Jonsson [Jun 28 14 00:26 ]:

2014-06-27 20:04, John MacFarlane skrev:

Try putting the attribute on the tr and table as well.
I believe the way it works is this: if you hit a block-level tag
without the attribute, then the whole contents of the tag are parsed
as HTML. (That includes any interior tags, whether or not they have
markdown=1.)

That's rather counter-intuitive. I would also have expected that
everything below a block level tag with markdown=1 would
'inherit' the positive value. Why not make it so and then make
markdown=0 significant so that one can turn the feature off
further down? I guess you could keep a stack with values for
'markdownness' at the different nesting levels (as in the
comments below).

[snip original example; improved below]

<table markdown=1>                          <!-- [1] -->
    <tr>                                    <!-- [1, 1] -->
        <td>*This* is markdown</td>         <!-- [1, 1, 1] -->
        <td markdown=0>                     <!-- [1, 1, 0] -->
            <p>This is *not* markdown</p>   <!-- [1, 1, 0, 0] -->
            <p markdown=1>                  <!-- [1, 1, 0, 1] -->
                But this *is* markdown!
            </p>
        </td>
    </tr>
</table>

Well, it turns out this IS the way it works in PHP Markdown Extra
and multimarkdown. And since the point of the extension is to
allow conversion between these formats, I should do it this way,
too.

It would be helpful if someone could put an issue up on the tracker
so I don't forget.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant