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

Allow Vim language specification for code block beginning #552

Merged
merged 1 commit into from
Feb 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/Locale/Po4a/VimHelp.pm
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ sub skip_tags {
sub is_tags {
my $line = shift;

$line =~ / \A \s* [*] [^*]+ [*] (?: \s+ [*] [^*]+ [*] )* (\s+ [>])? \Z /xms or return;
$line =~ / \A \s* [*] [^*]+ [*] (?: \s+ [*] [^*]+ [*] )* (\s+ [>] (vim)?)? \Z /xms or return;
my $codeblock = $1;

return { codeblock => $codeblock };
Expand Down Expand Up @@ -174,7 +174,7 @@ sub translate_codeblock_with_start_line {
}

sub is_codeblock_start_line {
return shift =~ / \A [>] \Z /xms;
return shift =~ / \A [>] (vim)? \Z /xms;
}

sub translate_paragraph {
Expand Down Expand Up @@ -221,7 +221,7 @@ sub translate_paragraph {
sub parse_paragraph_line {
my $line = shift;

$line =~ / \A (.*?) (\s+ [>])? \Z /xms or die "unreachable";
$line =~ / \A (.*?) (\s+ [>] (vim)?)? \Z /xms or die "unreachable";
my $content = $1;
my $codeblock = $2;

Expand Down
4 changes: 4 additions & 0 deletions t/fmt/vimhelp/basic.norm
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ basic15-90123456789012345678901234567890123456789012345678901234567890123456789

basic17-901234567890123456789012345678901234567890123456789012345678901234567あ
---------1---------2---------3---------4---------5---------6---------7---------

basic18-1 >vim
basic18-2
<
12 changes: 12 additions & 0 deletions t/fmt/vimhelp/basic.po
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,15 @@ msgid ""
msgstr ""
"BASIC17-901234567890123456789012345678901234567890123456789012345678901234567あ\n"
"---------1---------2---------3---------4---------5---------6---------7---------"

#. type: paragraph
#: basic.txt:24
#, no-wrap
msgid "basic18-1"
msgstr "BASIC18-1"

#. type: codeblock
#: basic.txt:25
#, no-wrap
msgid "basic18-2"
msgstr "BASIC18-2"
12 changes: 12 additions & 0 deletions t/fmt/vimhelp/basic.pot
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,15 @@ msgid ""
"basic17-901234567890123456789012345678901234567890123456789012345678901234567あ\n"
"---------1---------2---------3---------4---------5---------6---------7---------"
msgstr ""

#. type: paragraph
#: basic.txt:24
#, no-wrap
msgid "basic18-1"
msgstr ""

#. type: codeblock
#: basic.txt:25
#, no-wrap
msgid "basic18-2"
msgstr ""
4 changes: 4 additions & 0 deletions t/fmt/vimhelp/basic.trans
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ BASIC15-90123456789012345678901234567890123456789012345678901234567890123456789

BASIC17-901234567890123456789012345678901234567890123456789012345678901234567あ
---------1---------2---------3---------4---------5---------6---------7---------

BASIC18-1 >vim
BASIC18-2
<
4 changes: 4 additions & 0 deletions t/fmt/vimhelp/basic.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ basic15-90123456789012345678901234567890123456789012345678901234567890123456789

basic17-901234567890123456789012345678901234567890123456789012345678901234567あ
---------1---------2---------3---------4---------5---------6---------7---------

basic18-1 >vim
basic18-2
<