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

Differentiate between indented and fenced code block in the AST #507

Closed
mojavelinux opened this Issue May 16, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@mojavelinux
Contributor

mojavelinux commented May 16, 2018

It would be helpful when converting to other output formats if the parser added information to the AST to differentiate between an indented codeblock and a fenced codeblock. The use of these two forms often imply a different meaning (esp when both occur in the same document). At the moment, these two block types are indistinguishable in the AST.

I'm proposing a hint such as fenced: true in the options map for the parsed element (in the parse_codeblock_fenced method)

I'd be happy to provide a PR if this idea receives approval.

@gettalong gettalong self-assigned this May 16, 2018

@gettalong

This comment has been minimized.

Owner

gettalong commented May 16, 2018

Thanks for this proposal - I'm okay with adding such a hint. And would gladly accept a PR 😄 👍

@mojavelinux

This comment has been minimized.

Contributor

mojavelinux commented May 16, 2018

Fantastic! Thanks Thomas.

mojavelinux added a commit to mojavelinux/kramdown that referenced this issue May 17, 2018

@gettalong gettalong closed this in 55d4072 May 23, 2018

@gettalong

This comment has been minimized.

Owner

gettalong commented May 23, 2018

Thanks for your pull request - I have cherry-picked it.

@mojavelinux

This comment has been minimized.

Contributor

mojavelinux commented May 24, 2018

Thanks @gettalong!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment