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

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

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

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

mojavelinux opened this issue May 16, 2018 · 4 comments
Assignees
Labels

Comments

@mojavelinux
Copy link
Contributor

@mojavelinux 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
Copy link
Owner

@gettalong gettalong commented May 16, 2018

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

@mojavelinux
Copy link
Contributor Author

@mojavelinux 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
Copy link
Owner

@gettalong gettalong commented May 23, 2018

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

@mojavelinux
Copy link
Contributor Author

@mojavelinux 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants