Last active
April 12, 2016 05:07
-
-
Save hideki-a/53d3c5a0dd1e599839417517f786bfb1 to your computer and use it in GitHub Desktop.
EntryBodyFormatプラグイン:本文のフォーマットの選択値を<$mt:EntryBodyFormat$>で取得する。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: EntryBodyFormat | |
key: EntryBodyFormat | |
id: EntryBodyFormat | |
version: 1.00 | |
tags: | |
function: | |
EntryBodyFormat: > | |
sub { | |
my ($ctx, $args) = @_; | |
my $entry = $ctx->stash('entry') | |
or return $ctx->error("Tag called without an entry in context"); | |
my $format = $entry->convert_breaks || 'なし'; | |
if ($format eq '__default__') { | |
return '改行を変換'; | |
} else { | |
return $format; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
現状下記のような返値なので、L10Nで英語・日本語を統一した方がよさげ。