diff --git a/inst/rmarkdown/templates/moderncv/skeleton/moderncv.cls b/inst/rmarkdown/templates/moderncv/skeleton/moderncv.cls index 261b0662..0877b4c4 100644 --- a/inst/rmarkdown/templates/moderncv/skeleton/moderncv.cls +++ b/inst/rmarkdown/templates/moderncv/skeleton/moderncv.cls @@ -263,12 +263,12 @@ \NewDocumentCommand{\social}{O{}O{}m}{% \ifthenelse{\equal{#2}{}}% {% - \ifthenelse{\equal{#1}{linkedin}}{\collectionadd[linkedin]{socials}{\protect\httplink[#3]{www.linkedin.com/in/#3}}} {}% - \ifthenelse{\equal{#1}{xing}} {\collectionadd[xing]{socials} {\protect\httplink[#3]{www.xing.com/profile/#3}}}{}% - \ifthenelse{\equal{#1}{twitter}} {\collectionadd[twitter]{socials} {\protect\httplink[#3]{www.twitter.com/#3}}} {}% - \ifthenelse{\equal{#1}{github}} {\collectionadd[github]{socials} {\protect\httplink[#3]{www.github.com/#3}}} {}% - \ifthenelse{\equal{#1}{gitlab}} {\collectionadd[gitlab]{socials} {\protect\httplink[#3]{www.gitlab.com/#3}}} {}% - \ifthenelse{\equal{#1}{skype}} {\collectionadd[skype]{socials} {#3}} {}% + \ifthenelse{\equal{#1}{linkedin}}{\collectionadd[linkedin]{socials}{\protect\httpslink[#3]{www.linkedin.com/in/#3}}} {}% + \ifthenelse{\equal{#1}{xing}} {\collectionadd[xing]{socials} {\protect\httpslink[#3]{www.xing.com/profile/#3}}}{}% + \ifthenelse{\equal{#1}{twitter}} {\collectionadd[twitter]{socials} {\protect\httpslink[#3]{www.twitter.com/#3}}} {}% + \ifthenelse{\equal{#1}{github}} {\collectionadd[github]{socials} {\protect\httpslink[#3]{www.github.com/#3}}} {}% + \ifthenelse{\equal{#1}{gitlab}} {\collectionadd[gitlab]{socials} {\protect\httpslink[#3]{www.gitlab.com/#3}}} {}% + \ifthenelse{\equal{#1}{skype}} {\collectionadd[skype]{socials} {#3}} {}% } {\collectionadd[#1]{socials}{\protect\httplink[#3]{#2}}}} @@ -503,6 +503,23 @@ {\href{http://#2}{#2}}% {\href{http://#2}{#1}}} +% makes a https hyperlink with escaped underscore in link name +% usage: \httpslink[optional text]{link} +\newcommand*{\httpslink}[2][]{% + \ifthenelse{\equal{#1}{}}% + {\href{https://#2}{\expandafter\escapeunderscore\expandafter{#2}}} + {\href{https://#2}{\expandafter\escapeunderscore\expandafter{#1}}} +} + +\ExplSyntaxOn +\tl_new:N \l_escapeunderscore_tl +\cs_new:Npn \escapeunderscore #1 { + \tl_set:Nn \l_escapeunderscore_tl {#1} + \regex_replace_all:nnN {\_} {_} \l_escapeunderscore_tl + \tl_use:N \l_escapeunderscore_tl +} +\ExplSyntaxOff + % makes an email hyperlink % usage: \emaillink[optional text]{link} \newcommand*{\emaillink}[2][]{%