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

Use ```lang for code blocks if lang is set in the config #9

Merged
merged 5 commits into from May 24, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Next Next commit
Use ```lang for code blocks if lang is set in the config
=begin code :lang<perl6
foo
=end code

Will result in:
```perl6
foo
```
  • Loading branch information
samcv committed May 21, 2017
commit bf3a2e9bf3c23d47b25c19f40790c4409e639ecb
7 changes: 6 additions & 1 deletion lib/Pod/To/Markdown.pm6
Expand Up @@ -42,7 +42,12 @@ multi sub pod2markdown(Pod::Heading $pod) is export {

multi sub pod2markdown(Pod::Block::Code $pod) is export {
temp $in-code-block = True;
$pod.contents>>.&pod2markdown.join.trim-trailing.indent(4);
if $pod.config<lang> {
("```", $pod.config<lang>, "\n", $pod.contents>>.&pod2markdown, "```").join.trim-trailing;
}
else {
$pod.contents>>.&pod2markdown.join.trim-trailing.indent(4);
}
}

multi sub pod2markdown(Pod::Block::Named $pod) is export {
Expand Down