Skip to content

Instantly share code, notes, and snippets.

@hideki-a
Last active April 12, 2016 05:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hideki-a/53d3c5a0dd1e599839417517f786bfb1 to your computer and use it in GitHub Desktop.
Save hideki-a/53d3c5a0dd1e599839417517f786bfb1 to your computer and use it in GitHub Desktop.
EntryBodyFormatプラグイン:本文のフォーマットの選択値を<$mt:EntryBodyFormat$>で取得する。
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;
}
}
@hideki-a
Copy link
Author

現状下記のような返値なので、L10Nで英語・日本語を統一した方がよさげ。

  • なし
  • 改行を変換
  • richtext
  • markdown

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