[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: LaTeX.pm: implement @email.
From: |
Patrice Dumas |
Subject: |
branch master updated: LaTeX.pm: implement @email. |
Date: |
Thu, 19 Aug 2021 01:48:38 -0400 |
This is an automated email from the git hooks/post-receive script.
pertusus pushed a commit to branch master
in repository texinfo.
The following commit(s) were added to refs/heads/master by this push:
new 82e0560 LaTeX.pm: implement @email.
82e0560 is described below
commit 82e0560fb3f364b5e4001f3d48f45ac162de962e
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Thu Aug 19 07:48:17 2021 +0200
LaTeX.pm: implement @email.
---
tp/Texinfo/Convert/LaTeX.pm | 24 +++++++++++-----------
.../res_parser/formatting_latex/formatting.tex | 20 +++++++++---------
2 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/tp/Texinfo/Convert/LaTeX.pm b/tp/Texinfo/Convert/LaTeX.pm
index 0cc67a1..896bf53 100644
--- a/tp/Texinfo/Convert/LaTeX.pm
+++ b/tp/Texinfo/Convert/LaTeX.pm
@@ -1309,35 +1309,35 @@ sub _convert($$)
}
return $result;
} elsif ($command eq 'email') {
- # nothing is output for email, instead the command is substituted.
- my @email_contents;
if ($root->{'args'}) {
my $name;
+ my $converted_name;
my $email;
+ my $email_text;
if (scalar (@{$root->{'args'}}) == 2
and defined($root->{'args'}->[1])
and @{$root->{'args'}->[1]->{'contents'}}) {
$name = $root->{'args'}->[1]->{'contents'};
+ $converted_name = _convert($self, {'contents' => $name});
}
if (defined($root->{'args'}->[0])
and @{$root->{'args'}->[0]->{'contents'}}) {
$email = $root->{'args'}->[0]->{'contents'};
+ $email_text
+ = $self->_protect_url(Texinfo::Convert::Text::convert_to_text(
+ {'contents' => $email},
+ {'code' => 1,
+
Texinfo::Common::_convert_text_options($self)}));
}
- my $prepended;
if ($name and $email) {
- $prepended = $self->gdt('{name} @url{{email}}',
- {'name' => $name, 'email' => $email});
+ $result .= "\\href{mailto:$email_text}{$converted_name}";
} elsif ($email) {
- $prepended = $self->gdt('@url{{email}}',
- {'email' => $email});
+ $result .= "\\href{mailto:$email_text}{\\nolinkurl{$email_text}}";
} elsif ($name) {
- $prepended = {'contents' => $name};
- } else {
- return '';
+ $result .= $converted_name;
}
- unshift @{$self->{'current_contents'}->[-1]}, $prepended;
}
- return '';
+ return $result;
} elsif ($command eq 'uref' or $command eq 'url') {
if ($root->{'args'}) {
if (scalar(@{$root->{'args'}}) == 3
diff --git a/tp/tests/layout/res_parser/formatting_latex/formatting.tex
b/tp/tests/layout/res_parser/formatting_latex/formatting.tex
index 60c7392..e759f0e 100644
--- a/tp/tests/layout/res_parser/formatting_latex/formatting.tex
+++ b/tp/tests/layout/res_parser/formatting_latex/formatting.tex
@@ -191,9 +191,9 @@ but , ,\@
\texttt{@command\{{-}{-}a\}} \texttt{{-}{-}a}
\texttt{@dfn\{{-}{-}a\}} \emph{--a}
\texttt{@dmn\{{-}{-}a\}} --a
-\texttt{@email\{{-}{-}a,{-}{-}b\}} --b \url{--a}
+\texttt{@email\{{-}{-}a,{-}{-}b\}} \href{mailto:--a}{--b}
\texttt{@email\{,{-}{-}b\}} --b
-\texttt{@email\{{-}{-}a\}} \url{--a}
+\texttt{@email\{{-}{-}a\}} \href{mailto:--a}{\nolinkurl{--a}}
\texttt{@emph\{{-}{-}a\}} \emph{--a}
\texttt{@env\{{-}{-}a\}} \texttt{{-}{-}a}
\texttt{@file\{{-}{-}a\}} \texttt{{-}{-}a}
@@ -997,9 +997,9 @@ but , ,\@
\texttt{@command\{{-}{-}a\}} \texttt{{-}{-}a}
\texttt{@dfn\{{-}{-}a\}} \emph{--a}
\texttt{@dmn\{{-}{-}a\}} --a
-\texttt{@email\{{-}{-}a,{-}{-}b\}} --b \url{--a}
+\texttt{@email\{{-}{-}a,{-}{-}b\}} \href{mailto:--a}{--b}
\texttt{@email\{,{-}{-}b\}} --b
-\texttt{@email\{{-}{-}a\}} \url{--a}
+\texttt{@email\{{-}{-}a\}} \href{mailto:--a}{\nolinkurl{--a}}
\texttt{@emph\{{-}{-}a\}} \emph{--a}
\texttt{@env\{{-}{-}a\}} \texttt{{-}{-}a}
\texttt{@file\{{-}{-}a\}} \texttt{{-}{-}a}
@@ -1818,9 +1818,9 @@ but , ,\@
\texttt{@command\{{-}{-}a\}} \texttt{{-}{-}a}
\texttt{@dfn\{{-}{-}a\}} \emph{--a}
\texttt{@dmn\{{-}{-}a\}} --a
-\texttt{@email\{{-}{-}a,{-}{-}b\}} --b \url{--a}
+\texttt{@email\{{-}{-}a,{-}{-}b\}} \href{mailto:--a}{--b}
\texttt{@email\{,{-}{-}b\}} --b
-\texttt{@email\{{-}{-}a\}} \url{--a}
+\texttt{@email\{{-}{-}a\}} \href{mailto:--a}{\nolinkurl{--a}}
\texttt{@emph\{{-}{-}a\}} \emph{--a}
\texttt{@env\{{-}{-}a\}} \texttt{{-}{-}a}
\texttt{@file\{{-}{-}a\}} \texttt{{-}{-}a}
@@ -2623,9 +2623,9 @@ but , ,\@
\texttt{@command\{{-}{-}a\}} \texttt{{-}{-}a}
\texttt{@dfn\{{-}{-}a\}} \emph{--a}
\texttt{@dmn\{{-}{-}a\}} --a
-\texttt{@email\{{-}{-}a,{-}{-}b\}} --b \url{--a}
+\texttt{@email\{{-}{-}a,{-}{-}b\}} \href{mailto:--a}{--b}
\texttt{@email\{,{-}{-}b\}} --b
-\texttt{@email\{{-}{-}a\}} \url{--a}
+\texttt{@email\{{-}{-}a\}} \href{mailto:--a}{\nolinkurl{--a}}
\texttt{@emph\{{-}{-}a\}} \emph{--a}
\texttt{@env\{{-}{-}a\}} \texttt{{-}{-}a}
\texttt{@file\{{-}{-}a\}} \texttt{{-}{-}a}
@@ -3428,9 +3428,9 @@ but , ,\@
\texttt{@command\{{-}{-}a\}} \texttt{{-}{-}a}
\texttt{@dfn\{{-}{-}a\}} \emph{--a}
\texttt{@dmn\{{-}{-}a\}} --a
-\texttt{@email\{{-}{-}a,{-}{-}b\}} --b \url{--a}
+\texttt{@email\{{-}{-}a,{-}{-}b\}} \href{mailto:--a}{--b}
\texttt{@email\{,{-}{-}b\}} --b
-\texttt{@email\{{-}{-}a\}} \url{--a}
+\texttt{@email\{{-}{-}a\}} \href{mailto:--a}{\nolinkurl{--a}}
\texttt{@emph\{{-}{-}a\}} \emph{--a}
\texttt{@env\{{-}{-}a\}} \texttt{{-}{-}a}
\texttt{@file\{{-}{-}a\}} \texttt{{-}{-}a}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: LaTeX.pm: implement @email.,
Patrice Dumas <=