mirror of
https://github.com/moderncv/moderncv.git
synced 2026-02-06 10:05:19 +01:00
Add URL encoding to links containing non-ASCII characters
This commit is contained in:
parent
853e216435
commit
fa3ebb6b48
1 changed files with 32 additions and 13 deletions
45
moderncv.cls
45
moderncv.cls
|
|
@ -120,6 +120,11 @@
|
||||||
pdfsubject = {R\'{e}sum\'{e} of \@firstname{}~\@lastname{}},
|
pdfsubject = {R\'{e}sum\'{e} of \@firstname{}~\@lastname{}},
|
||||||
pdfkeywords = {\@firstname{}~\@lastname{}, curriculum vit\ae{}, r\'{e}sum\'{e}}}}
|
pdfkeywords = {\@firstname{}~\@lastname{}, curriculum vit\ae{}, r\'{e}sum\'{e}}}}
|
||||||
|
|
||||||
|
% pdftex not using pdfmanagement-testphase requires T1 font encoding in order to handle links containing special characters somewhat properly
|
||||||
|
\ifpdftex
|
||||||
|
\IfPDFManagementActiveTF{}{\RequirePackage[T1]{fontenc}}
|
||||||
|
\fi
|
||||||
|
|
||||||
% graphics
|
% graphics
|
||||||
\RequirePackage{graphicx}
|
\RequirePackage{graphicx}
|
||||||
|
|
||||||
|
|
@ -565,25 +570,39 @@
|
||||||
|
|
||||||
% makes a generic hyperlink
|
% makes a generic hyperlink
|
||||||
% usage: \link[optional text]{link}
|
% usage: \link[optional text]{link}
|
||||||
\newcommand*{\link}[2][]{%
|
% uses pdfmanagement-testphase when available, which provides url encoding of special characters
|
||||||
\ifthenelse{\equal{#1}{}}%
|
\NewDocumentCommand{\link}{O{}m}{%
|
||||||
{\href{#2}{#2}}%
|
\IfPDFManagementActiveTF{%
|
||||||
{\href{#2}{#1}}}
|
\ifthenelse{\equal{#1}{}}%
|
||||||
|
{\hrefurl[urlencode]{#2}{#2}}%
|
||||||
|
{\hrefurl[urlencode]{#2}{#1}}}{%
|
||||||
|
\ifthenelse{\equal{#1}{}}%
|
||||||
|
{\href{#2}{#2}}%
|
||||||
|
{\href{#2}{#1}}}}
|
||||||
|
|
||||||
% makes a http hyperlink
|
% makes a http hyperlink
|
||||||
% usage: \httplink[optional text]{link}
|
% usage: \httplink[optional text]{link}
|
||||||
\newcommand*{\httplink}[2][]{%
|
% uses pdfmanagement-testphase when available, which provides url encoding of special characters
|
||||||
\ifthenelse{\equal{#1}{}}%
|
\NewDocumentCommand{\httplink}{O{}m}{%
|
||||||
{\href{http://#2}{#2}}%
|
\IfPDFManagementActiveTF{%
|
||||||
{\href{http://#2}{#1}}}
|
\ifthenelse{\equal{#1}{}}%
|
||||||
|
{\hrefurl[urlencode]{http://#2}{#2}}%
|
||||||
|
{\hrefurl[urlencode]{http://#2}{#1}}}{%
|
||||||
|
\ifthenelse{\equal{#1}{}}%
|
||||||
|
{\href{http://#2}{#2}}%
|
||||||
|
{\href{http://#2}{#1}}}}
|
||||||
|
|
||||||
% makes an https hyperlink
|
% makes an https hyperlink
|
||||||
% usage: \httpslink[optional text]{link}
|
% usage: \httpslink[optional text]{link}
|
||||||
\newcommand*{\httpslink}[2][]{%
|
% uses pdfmanagement-testphase when available, which provides url encoding of special characters
|
||||||
\ifthenelse{\equal{#1}{}}%
|
\NewDocumentCommand{\httpslink}{O{}m}{%
|
||||||
{\href{https://#2}{#2}}%
|
\IfPDFManagementActiveTF{%
|
||||||
{\href{https://#2}{#1}}}
|
\ifthenelse{\equal{#1}{}}%
|
||||||
|
{\hrefurl[urlencode]{https://#2}{#2}}%
|
||||||
|
{\hrefurl[urlencode]{https://#2}{#1}}}{%
|
||||||
|
\ifthenelse{\equal{#1}{}}%
|
||||||
|
{\href{https://#2}{#2}}%
|
||||||
|
{\href{https://#2}{#1}}}}
|
||||||
|
|
||||||
% makes an email hyperlink
|
% makes an email hyperlink
|
||||||
% usage: \emaillink[optional text]{link}
|
% usage: \emaillink[optional text]{link}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue